The TOWRP software was entirely written in PIC Assembly. The three primary software portions were communications, the main state machine, and velocity/pwm commands.

The communications sub-section covers the SPI communications protocol as well as receiving messages and decoding. The state machine goes over the communications protocol state machine.

Lastly, the velocity/pwm section covers how forward and rotational velocity commands were translated to individual PWM commands for each motor.

TOWRP Software Listing

PIC_Xbee.asm
PIC_Slave_Motor.asm