beautypg.com

Getting started with neuron c – Echelon Mini FX User Manual

Page 82

background image

Mini FX User's Guide

69

Declaration Example
Configuration Properties

SCPTdefOutput cp_family cpDefaultOut;

Functional Blocks

fblock SFPTnodeObject { … } myNode;

Getting Started with Neuron C

This section provides a series of Neuron C examples that demonstrate how to use Neuron

C to perform I/O functions. These programming examples are designed to work with

both the FT 5000 EVB and the PL 3150/PL 3170 EVB, with minor functional differences
based on the hardware and system resources on the boards. The examples use the I/O

devices on the FT 5000 EVB, and the Mini Gizmo I/O board that you can attach to a PL
3150/PL 3170 EVB. The I/O devices used in these examples include the push buttons,

LEDs, temperature sensors, serial ports, and displays on the boards. By following these

examples, you will create a set of I/O utility functions that is summarized in I/O
Examples Toolkit
later in this chapter. These utility functions are used in the

subsequent example device applications.
This section then provides a series of increasingly complex device applications based on
the I/O examples. These device applications introduce Neuron C and device development

concepts such as I/O objects and timers, network variables, configuration properties,
functional profiles, and Interoperable Self-Installation (ISI). The device applications are

as follows:
• A digital sensor that senses a push button, and a digital actuator that drives an LED.
• A thermostat that samples ambient temperature readings, displays current and

setpoint temperature values, executes a controller algorithm to drive a heating and
cooling system, and provides status information.

You can copy the programming examples or the complete device applications to a text

editor, save them to a file with an .nc extension, and then build and download them into
your EVB with the Mini FX Application.
Note: You must use the .nc file extension for Neuron C source code. You cannot use the

.c file extension, which is common to ANSI C programmers. If you compile code
packaged in a file with a .c file extension, the Neuron C Compiler classifies the source as

“pure C” and disables most of the Neuron C extensions. As a result, you will not be able
to download the resulting application image file into a Neuron Chip or Smart

Transceiver. You cannot use the Mini kit to create user-defined function libraries with

the pure C feature, but you can use the NodeBuilder tool to create them with pure C.

If you have changed the jumper configurations on your EVB, you must return them to

their default settings to run the examples provided in this chapter. Table 5-3 lists the

minimum jumper configurations required for the FT 5000 EVB, PL 3150 EVB, and PL
3170 EVB to run the examples. The table lists separately the jumper pins that must be

connected and disconnected.
See the FT 5000 EVB Hardware Guide for more information on the jumper locations and
settings of the FT 5000 EVB. See the Mini FX/PL Examples Guide for more information

on the jumper locations and settings of the PL 3150/PL 3170 EVB.