Protocol of µC stepper <=> PC communication

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

PC  Address ("CR" not allowed)
PC  Motor No. (ranging from 0 to 8, number as ascii code)
PC  Direction & Mode (ranging from 0 to 7, number as ascii code)
PC  Steps Digit 4 (ranging from 0 to 9, number as ascii code)
...
PC        Digit 1 (ranging from 0 to 9, number as ascii code)
PC  Time  Digit 2 (ranging from 0 to 9, number as ascii code)
PC        Digit 1 (ranging from 0 to 9, number as ascii code)
PC  "CR"

Motor No. decode as follows
0   Motor 0
1   Motor 1
2   Motor 2
3   Motor 3
4   write GPIO
5   read GPIO
6   snapshot steps to do
7   set maximum steptime and acceleration
8   check motors running

Direction & Mode decode as follows
0   full step, clockwise
1   full step, counterclockwise
2   half step, clockwise
3   half step, counterclockwise
4   wave, clockwise
5   wave, counterclockwise
6   wave, clockwise
7   wave, counterclockwise

Example: "B04035412"
device address B; motor 0; wave, clockwise; 354 steps; steptime 12 ms

Please note:
The command end sign is not allowed to appear at any other position.
If motor no. is out of range the command is ignored.
Further characters following time 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