The interface
protocol at this stage is a
custom interface. Hopefully as more development and publication of
information on the IEEE1451 standards occur, this may be
changed later. A small amount of information relating to the IEEE1451
message interface is available. From this was selected an interface
protocol that aims to have some compatibility to allow a transition to
occur readily.
Packet Structure
Serial messages have a packet structure
consisting of a string of bytes with the following form:
|
Function
|
Value
|
Number Bytes
|
|
Synchronization
|
0xDD
|
variable
|
|
Start of Message
|
0x16
|
1
|
|
Address/Packet Type
|
0-31,0-7
|
1
|
|
Data Length
|
0-255
|
1
|
|
Command
|
0-255
|
1
|
|
Data
|
0-255
|
0-limit
|
|
Checksum
|
|
1
|
|
End of Message
|
0x03
|
1
|
-
The synchronization character is
transmitted during idle periods in response to any received character,
to enable the link to be synchronized in baud rate. Details are given
in the full specification document.
-
The address is a 5 bit representation
of the module identifier used to address a specific module in a
multiple-module environment.
-
Packet type is a 3 bit word that allows
different packet structures to be used, for example, very short
cut-down packets for real-time commands, broadcast commands etc. The
use of different packet types will be minimized in order to manage the
complexity of the interface. Some AVR microcontrollers have as much as
128KBytes of Flash memory, and may be able to handle such complexity.
-
The data length includes the command
and all parameters and data following, but excludes the checksum and
end-of-message character.
- The number of data bytes present can be
from 0 to a limit that is dependent on the internal buffer size in the
DAU. This is nominally 16.
Commands are defined below. There is scope
for a very large number of these but in practice we aim to develop
rather generic commands and minimize specialized commands so that the
interface is kept simple. It must be independent of the microcontroller
used.
Commands
-
Unit ID Read (0x1). This
command causes the microcontroller to return a small amount of
information about its capabilities and athe address of the unit
information block.
-
Read Memory (0x2). This causes
a block of internal EEPROM memory to be passed back to the PC.
-
Write Memory (0x3). This causes
a block of internal EEPROM memory to be written to the device,
overwriting the contents.
-
Read I²C Memory (0x4).
This causes
a block of external EEPROM memory to be passed back to the PC.
-
Write I²C Memory (0x5). This causes
a block of external EEPROM memory to be written to the device,
overwriting the contents.
-
Read and Reset Data Memory
Buffer (0x6). This command allows the captured data to be downloaded to
a PC and the buffer to be reset ready for more captures.
-
Reset Real Time Clock
(0x7). The real time clock is reset to zero.
-
Error (from
microcontroller) (0x10). This returns an error code and any additional
qualifying
information defined for the error.
-
Success (from
microcontroller) (0x11). This returns requested data if any.
-
Offset Calibrate (0x20).
This command causes the microcontroller to run an offset
calibration on the DAU. In the case that the DAU has an analogue input
module, this shall short the inputs and an A/D converter read shall be
executed on the specified channel and programmable gain setting.
-
Single Read ADC Command
(0x21). Start and read the A/D
converter immediately on the specified channel and programmable
gain setting.
-
Multiple Read ADC Command
(0x22). Create a process to start and read the A/D converter at specified intervals until the data memory
buffer is full. Once started, this command will return an error if
another command is received while the process is still active.
- Set ADC Conversion
Information (0x23). This writes a channel control byte to control the
parameters of the ADC conversion process.
- Abort
ADC Process (0x24). This aborts the ADC conversion process.
- Firmware
Upload (0x40). This causes the program to jump to a bootloader. If no
bootloader is present, this simply resets the microcontroller.
- Debug Read SRAM (0x42).
This causes
a block of internal SRAM memory to be passed back to the PC.
-
Debug Write Memory (0x43). This causes
a block of internal SRAM memory to be written to the device,
overwriting the contents.
-
Debug Set Port Bit (0x44).
This causes a specified bit of a particular I/O port to be set.
- Debug Clear Port Bit (0x45).
This causes a specified bit of a particular I/O port to be cleared.
-
Debug Read Port Input Pins (0x45).
This causes the I/O pins of the specified I/O port to be read. The AVR devices have a separate register
for each external I/O port, for the values that were written to the
port for the output pins, and another address to read the external
signals presented at the pins that are set as inputs. This command
accesses the latter.
Contact:
My email address can be constructed
from the
username "ksarkies" and the
ISP DNS address internode.on.net
in the
usual
way.
|