COACH PIC C Code
Top level COACH state machine. This module keeps track of what state the COACH is in. The module also processes all received messages from the UART RX. Decision trees are used to determine the content of the message and then report out to other state machines to control outputs.
coachprotocolfsm.c | |
File Size: | 19 kb |
File Type: | c |
coachprotocolfsm.h | |
File Size: | 0 kb |
File Type: | h |
SPI state machine on the PIC. PIC was configured as a slave and shifted out a status byte on every receive from the 'C32 master. Updated buffer values for speed and orientation upon receipt of relevant commands.
pic_spi_fsm.c | |
File Size: | 8 kb |
File Type: | c |
pic_spi_fsm.h | |
File Size: | 1 kb |
File Type: | h |
UART receive state machine. This machine control receiving messages from the XBee over UART. The machine does some simple checking of the message to ensure a good packet. Contents of the message are stored in memory buffer. Upon receiving a good checksum the machine alerts other machines that there is a good packet to be processed.
picuartrxfsm.c | |
File Size: | 15 kb |
File Type: | c |
picuartrxfsm.h | |
File Size: | 1 kb |
File Type: | h |
UART transmit state machine. This machine receives content to send over UART via the XBee. The massage is packaged correctly and then transmitted byte-by-byte via UART.
picuartrxfsm.c | |
File Size: | 15 kb |
File Type: | c |
picuarttxfsm.h | |
File Size: | 1 kb |
File Type: | h |
System initializations and Main
testmain.c | |
File Size: | 2 kb |
File Type: | c |
Comm Defines.
commdefines.h | |
File Size: | 0 kb |
File Type: | h |
All project files for Coach PIC.
source.zip | |
File Size: | 1926 kb |
File Type: | zip |
Coach C32 C Code
Top level state machine to handle SPI communication between the 'C32 and the radio PIC. 'C32 was master. Each SPI transfer consisted of two bytes: a header byte that signaled what data was about to be sent (i.e. orientation, speed, button press, etc.) and a subsequent data byte that contained the appropriate value.
spi_c32_fsm.c | |
File Size: | 16 kb |
File Type: | c |
spi_c32_fsm.h | |
File Size: | 1 kb |
File Type: | h |
Ed's A/D module.
ads12_c32.c | |
File Size: | 8 kb |
File Type: | c |
ads12.h | |
File Size: | 0 kb |
File Type: | h |
SPI communication module. Includes initialization function for SPI system on the 'C32 and basic functions to read and write bytes.
spi.c | |
File Size: | 7 kb |
File Type: | c |
spi.h | |
File Size: | 0 kb |
File Type: | h |
Event checkers. This module contains the event checker used to generate events for the COACH system (mainly button presses).
eventcheckers.c | |
File Size: | 15 kb |
File Type: | c |
eventcheckers.h | |
File Size: | 0 kb |
File Type: | h |
Initialization and Main. This module sets up various register and runs the Main() function.
testmain.c | |
File Size: | 2 kb |
File Type: | c |
The following ZIP archives list all source code and headers used on the COACH C32.
sources.zip | |
File Size: | 146 kb |
File Type: | zip |
headers.zip | |
File Size: | 69 kb |
File Type: | zip |