Getting started with neuron c, Input/output – Echelon Mini EVK User Manual

Page 46

Advertising
background image

•Configuration Properties

SCPTdefOutput cp_family cpDefaultOut;

•Functional Blocks

fblock SFPTnodeObject { … } myNode;

•Message tags

msg_tag command;

Getting Started with Neuron C

This section introduces Neuron C with a series of examples. Neuron C

concepts are introduced one at a time, and each concept is integrated into the

following examples:

• A digital sensor that senses a push button.
• An analog sensor that reads a temperature value.
• A digital actuator that controls an LED.
• A serial actuator that controls a device via a serial connection.

The first four examples in the Input/Output section below are example

functions used in the remaining examples, which are complete Neuron C
applications that you can copy to Windows Notepad or another editor, save to

a file with a .nc extension, and then compile and download the file to one of

the evaluation boards included with the Mini EVK.
Note that the source file must not use the .c file extension, as is common to

ANSI-C programmers. Instead, the .nc file extension is recommended for
Neuron C source code. When compiling 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. The resulting image file cannot be

loaded into a Neuron Chip or Smart Transceiver. The Pure C feature may be

used with the NodeBuilder Development Tool, but not the Mini EVK, to
create user-defined function libraries.
The digital sensor, analog sensor, and digital actuator examples all use the

I/O hardware on the MiniGizmo I/O board, so the MiniGizmo must be
attached to your evaluation board to run these examples. The serial actuator

example uses the serial interface on the evaluation boards. To use this

interface, insert the JP201 I010 jumper on the evaluation board to enable the
serial output port, connect the board to your computer using a male DB-9 to

female DB-9 serial extension cable (pins wired straight through), and then

run Windows HyperTerminal on your computer to monitor the serial output.
Configure HyperTerminal for direct connection to your serial port (typically

COM1 or COM2), 4800 bps, 8 data bits, no parity, one stop bit, and no flow
control. Compatible serial extension cables include the Radio Shack #26-117

6-Ft. Serial RS-232C Cable, Outpost.com (Fry’s Electronics) #2007427 Serial

Mouse Extension Cable, cdw.com #086872 Belkin Serial Extension DB9M
toDB9F 6' Cable, or the Belkin F2N209-06-T Serial Extension DB9M to

DB9F 6’ Cable.

Input/Output

A Neuron Chip or Smart Transceiver may be connected to one or more
physical I/O devices via up to 12 versatile I/O pins. Examples of simple I/O

40

Mini EVK User’s Guide

Advertising