
   Using 20MHz Neuron Chips with Echelon Development Tools
   -------------------------------------------------------

NEI20MHZ.TXT                                    Rev 3.00 HR 08/25/98

TABLE OF CONTENTS

Overview
LonBuilder Instructions
NodeBuilder Instructions
The NEI20MHZ Utility
Interoperability Considerations for 20MHz Nodes
Neuron C Programming of 20MHz Nodes

Overview
========

This archive contains two files:

NEI20MHZ.TXT            This read-me file
NEI20MHZ.EXE            DOS utility program for 20MHz input clock

To build any firmware image for a Neuron Chip, you need to install
system firmware symbol table files into your LonBuilder or NodeBuilder
software.  Instructions for installing these files are supplied separately.

If the input clock for your Neuron Chip is 10MHz or less, you can
use the LonBuilder or NodeBuilder software to build firmware images
in the usual way.  However, these tools do not directly support
the 20MHz input clock option that is available with the 3120FEx 
and 3120A20 chips. In this case, you will need to use the NEI20MHZ.EXE 
utility program to overcome this limitation.

To build an application for a Neuron Chip running at 20MHz input clock,
use your LonBuilder or NodeBuilder software to create the Neuron
EEPROM Image file (.NEI file), and then post-process that file with
the NEI20MHZ utility.  This updates the communications parameter record
in the file. You can then download this modified .NEI file to a Neuron
3120 Programmer to program the devices before soldering them to your
target hardware board.

LonBuilder Instructions
=======================

Copy the file NEI20MHZ.EXE into the \LB directory.

Go into the LonBuilder software, and select App Node, then Properties,
then Create.  Fill in the fields as follows:

HW Property name        (for example) 3120FE_props
NEURON Chip             Select from the pull-down menu (*)
Firmware Version        (+)
Neuron Chip Firmware    <blank>
Input Clock Rate        Select from the pull-down menu (-)

(*) Select 3120Ex for either the 3120Ex or 3120FEx.

(+) Firmware version 0 means the default version.

(-) If your input clock is 10MHz or less, you can select it from the
pull-down menu and continue as normal.  In this case, you do not need
to use the NEI20MHZ.EXE utility program.  You cannot select an input
clock of 20MHz from the menu.  If you will be using a 20MHz input clock,
set the clock field to any value, because this parameter will be overridden
later.

Save the Hardware Properties record, select Target HW, then Create.
Fill in the fields as follows:

App HW Name             (for example) 3120FE_hw
HW Type                 Custom Node from the pull-down menu
Channel Name            Select from the pull-down menu (*)
HW Prop. Name           (for example) 3120FE_props

(*) If your input clock is 10MHz or less, you can select the channel
from the pull-down menu and continue as normal.  In this case, you do
not need to use the NEI20MHZ.EXE utility program.  If you will be using
a 20MHz input clock, set the channel field to any defined channel,
because this parameter will be overridden later.

Save the Target Hardware record, select Node Specs, then Create.
Fill in the fields as follows:

Node Name               (for example) MY_NODE
App Image Name          Neuron C source file name (without the .NC)
Target HW               (for example) 3120FE1_hw

All other fields can be left as is.

Save the Node Specs record, and select Automatic Build from the
Project menu.  Ignore any warning that the node hardware is not
ready to load.

If your program successfully compiles and links, go to the Node Specs
window, click to the left of the node name, and click on More>, then
on Export.  Check the following options in the dialog screen:

File Type               EEPROM, Flash, or NEURON 3120 Image
File Format             Intel Hex fmt.
Application State       Unconfigured or Configured as required

Note the File Base Name - it is usually the same as the first
8 characters of the Node Name, for example MY_NODE.  Click on OK,
and the .NEI file, for example MY_NODE.NEI, will be created.

If your input clock is 10MHz or less, use this .NEI file with your
LonWorks Neuron 3120 Programmer in the usual way.  If your input clock
is 20MHz, follow the instructions in to the section below describing
the NEI20MHZ utility.

NodeBuilder Instructions
========================

Copy the file NEI20MHZ.EXE into the \LONWORKS\BIN directory.

Go into the NodeBuilder software, and select New from the File menu.
In the document type selection window, select Device Template, and
click OK.

In the Device Template Hardware tab, fill in the fields as follows:

Target Hardware:        Other
Neuron Model:           Select from the pull-down menu (*)
Clock Speed:            (+)
Transceiver Type:       (-)

(*) Select 3120Ex for either the 3120Ex or 3120FEx.

(+) If your input clock is 10MHz or less, you can select it from the
pull-down menu and continue as normal.  In this case, you do not need
to use the NEI20MHZ.EXE utility program.  You cannot select an input
clock of 20MHz from the menu.  If you will be using a 20MHz input clock,
set the clock field to any value, because this parameter will be overridden
later.

(-) If your input clock is 10MHz or less, you can select the channel
from the pull-down menu and continue as normal.  In this case, you do
not need to use the NEI20MHZ.EXE utility program.  If you will be using
a 20MHz input clock, set the channel field to any defined channel type,
because this parameter will be overridden later.

In the Firmware tab, fill in the fields as follows:

System Image:           (*)
Version:                (+)
Image Name:             (not modifiable)

(*) Select Default Version or Other Standard Version.

(+) Determine the correct firmware version for your chip and enter here
    if it is not the default version.

Other tabs in the Device Template window may be filled in as desired.

Select Save or File/Save or File/Save As...,
and enter a name for this template, for example 3120FE.DTM.
Templates should be saved in the \LONWORKS\TEMPLATE directory.

Create a new Device, for example by selecting New from the File menu.
In the document type selection window, select Device, and click OK.

In the Device General tab, fill in the fields as follows:

Application Image
Type:   Source
        <Neuron C source file name>

Device Template
(for example)   c:\lonworks\template\3120fe.dtm

Other tabs in the Device window may be filled in as desired.
Select Save or File/Save or File/Save As..., and
enter a name for this device, for example MY_NODE.DEV.

Make sure that the NodeBuilder software is Attached, and
select Build from the Build menu, or click on the Build icon.
If your program successfully compiles and links, the .NEI file,
for example MY_NODE.NEI, will be created.

If your input clock is 10MHz or less, use this .NEI file with your
LonWorks Neuron 3120 Programmer in the usual way.  If your input clock
is 20MHz, follow the instructions in to the section below describing
the NEI20MHZ utility.

The NEI20MHZ Utility
====================

This is a simple DOS utility that post-processes the .NEI file
generated by LonBuilder or NodeBuilder in order to modify the clock
and communications parameters for 20MHz. If your input clock is
10MHz or less, you do not need to use this utility, even if your
Neuron Chips are capable of running at 20MHz.

Enter NEI20MHZ at the DOS command prompt for usage information:

Copyright (c) 1997 Echelon Corporation.  All rights reserved
Convert Neuron Chip 3120FEx .NEI file to 20MHz clock.

Usage:  NEI20MHZ -c<channel> file_name[.NEI]
Channel names:          Description               Minimum Clock Rate
        TP/XF-78        Twisted Pair at 78kbps           5 MHz
        TP/XF-1250      Twisted Pair at 1.25Mbps        10 MHz
        TP/FT-10        Free Topology or Link Power      5 MHz
        PL-10           Spread Spectrum Power Line       5 MHz
        TP/RS485-39     RS485 at 39kbps                  5 MHz
        TP/RS485-78     RS485 at 78kbps                  5 MHz
        TP/RS485-625    RS485 at 625kbps                 5 MHz
        TP/RS485-1250   RS485 at 1.25Mbps               10 MHz
        TP/RS485-2500   RS485 at 2.5Mbps                20 MHz
        DC-78           Direct Connect at 78kbps         5 MHz
        DC-625          Direct Connect at 625kbps        5 MHz
        DC-1250         Direct Connect at 1.25Mbps      10 MHz
        DC-2500         Direct Connect at 2.5Mbps       20 MHz

For example, if you wish to modify the file MY_NODE.NEI for a 20MHz
Neuron Chip with the TP/XF-1250 twisted pair transceiver, enter:

NEI20MHZ -cTP/XF-1250 MY_NODE.NEI

This replaces the communications parameter record in the file with
the communications parameters appropriate to 20MHz and the TP/XF-1250
transceiver.

If the utility executes correctly, it will report, for example:

Neuron model number: 9,  Firmware version: 7
Successfully updated file MY_NODE.NEI to 20MHz operation
on TP/XF-1250 channel.

Defined Neuron Chip model numbers are as follows:
        3150            0
        3120            8
        3120(F)E1       9
        3120(F)E2       10
        3120FE3         11
        3120A20         12
        3120FE5         13

Now that you have a suitable .NEI file, you can use the LonWorks Neuron
3120 Programmer (Echelon Model 21700) to program your chips.  
Then solder the chips into your target circuit board
with the specified transceiver.  It is not possible to download 20MHz
communications parameters into a device over the network using LonBuilder
or NodeBuilder software.

The latest software for the Neuron 3120 Programmer may be downloaded
from the LonWorks Developer's Toolbox on the World Wide Web at
http://www.echelon.com/Services/dev_toolbox/updates/3120_prog/3120prog.zip

Interoperability Considerations for 20MHz Nodes
===============================================

20MHz nodes will interoperate with other nodes that conform to the
minimum clock rate listed above.  For example, you can use a LonWorks
network interface or router running at 10MHz to communicate with
nodes running at 20MHz, as long as the channel bit rate is 1.25Mbps
or less.

There is currently no way to connect a LonWorks network interface or
router to a channel running at 2.5Mbps.

Note that the PL-20 and PL-30 power line channels, as well as the
4.8kbps radio frequency channels are not supported at 20MHz.  You
can, of course, use the 20MHz chips with an input clock of 10MHz or
less.

Neuron C Programming of 20MHz Nodes
===================================

A 20MHz Neuron Chip will run most I/O models at twice the speed
specified for 10 MHz.  The following table lists some of the
timings at 20MHz.

I/O Model               Timing
---------               ------
Parallel                1.2 microsec per byte
Bitshift                2, 20 or 30 kbps
Magcard                 Up to 16,668 bps
Magtrack1               Up to 14,492 bps
Neurowire Master        2, 20 or 40 kbps
Neurowire Slave         Up to 36 kbps
Serial                  1200, 2400, 4800 or 9600 bps
Touch                   Not supported at 20 MHz
Frequency Output        Resolution 0.2 to 25.6 microsec
                        Maximum Range 13.1 to 1678 msec
Other Timer/Counter     Resolution 0.1 to 12.8 microsec
                        Maximum Range 6.55 to 839 msec

Some timers have different specifications at 20 MHz,
as shown in the following table:

Watchdog timer                  420 msec
Millisecond timers              1 to 32,000 msec
Second timers                   1 to 65,000 sec
delay() function                1 to 32,767 counts
get_tick_count() function       409.6 usec per count

Other timers and time-related functions are not affected.

It is permissible to write up to 32 bytes of EEPROM memory
in one operation, even though this can take up to 640 msec.
Version 7 (and later) firmware updates the watchdog timer
after every byte written to EEPROM.
