Protocol of uCADC <=> PC communication

!!! every byte is "echoed" by the µC !!!

PC  Address ("CR" not allowed)
PC  Command No. (ranging from 0 to 7, number as ascii code)
PC  Value Digit 4 (ranging from 0 to 9, number as ascii code)
...
PC  Value Digit 1 (ranging from 0 to 9, number as ascii code)
PC  "CR"

Commands
0   init integrator, ADC offset, wait for IRQ, value is integration time
1   waiting for IRQ, value dummy
2   read ADC data
    value = 0 after integration or last command 7 data
    value = 1 before integration
3   write GPIO
4   read GPIO
5   get uC Version, value dummy
6   write no of ADC channels
7   get ADC values instandly, value dummy


Example: "B04035"
device address B; command 0; init integrator, save offset, integrate for 403.5ms

Please note:
The command end sign is not allowed to appear at any other position.
If command no. is out of range the command is ignored.
Further characters following value digit 1 will be ignored. Commands with
more than 128 bytes will lead to an overflow. The length of command
lines for non µC control devices is not limited.

Disclaimer: No warranty at all!
Copyright by Martin Clausen, Germany.
Contact the author: mc AT rotgradpsi DOT de
Impressum