#cairo/servocon: motorcontroller firmware
##desc This project contains the firmware for the motor-controller, which is installed on 3 PiCs (16F1827), with 3 different addresses. Each PiC handles 4 servos which can be set by sending 2 bytes per to the device via uart (rs-232). Since the uart is chained together (normally you don't do such a thing) the first byte must contain the address for the PiC. Additionally this byte also contains a mode and the servo address.
##controlling the servos The PiC waits until it has received 2 bytes of information, where the first byte is denoted with the 7th set to 1. It then checks the encoded address in the package and takes action, if the address matches the own address, otherwise, the data is dropped.
bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
byte 0 | 1 | PiC addr. | servo addr. | mode | pos.msb | |||
byte 1 | 0 | pos | pos.lsb |