Communication Protocol
This is the definition of the communication protocol between the hardware and the software.
It is purely ASCII/text, so that debugging is easy. Simply open your favourite serial terminal and try the commands.
The commands start with a single letter, some options and an closing [Return]. All answers are followed by a return as well.
The port settings are: 115200 Baud, 8 Bit, 1 Stopbit, No Parity.
Commands
- V - Return the name and version of the installed software. See below for return values.
- C - Set the current in one or more coils. 'C' is followed by the coil number (0-7), a non-number character and the value for the DA converter (0 - 4095). The commands for the different coils are separated by ',' or ' ' or whatever (everything except a number).
- U - Get the state of the voltage comparators. The 8 results are returned as a string of 1 and 0s.
- G - Gets the value of variables the system. (G CHANNEL_COUNT[Return])
- S - Sets variables in the system. (S LED=1[Return])
- Z - Put the system in a safe state. Zeros the currents. It is done by setting all DACs to 2048 and turning the binary outputs (LED) to low.
- F - Start a function, for example a coil measurement.
- R - 'Ready?' - Test if the last function started has finished. It returns 0 or 1.
- D - Debug output. Will change a lot.
Examples
Example for the C command:
C 1 500 2 0 4 423 7 432 0 2047[Return]
or
C 0=1 4=3212 2=0[Return]
or
C0=1C4=3212C2=0[Return]
or
Coil 0 = 3000, coil 4 is 120 and the last coil will be coil 5 with a value of 1024 for its DAC.[Return]
Variables
- VERBOSE - (read/write) Put every command on the screen. The default is 1. Turned off for faster DAC updates.
- CHANNEL_COUNT - (read only) Number of channels on the DACs.
- LED - (read/write) Turns the led on the board on (= 1) and off (= 0).
Functions
None yet...
But there will be some for testing of the resistivity and the inductivity of the coil.