Remote - Software

When the remote is first turned on the code is directed to the boot up sequence which turns off the LCD, sets up the stack, variables, pins, uart ports, splash screen and menus for the LCD and finally turns on the LCD and begins it's main task. Once in the main loop the code ensures global interrupts are enabled, alternates between reading the temperature and power and if ready, will refresh the menu screen. The process repeats indefinitely while processing interrupts as they occur.

The system clock runs at 8 MHz while the three onboard timers used run at 7.8kHz (timer 1 - used for testing purposes), 31 kHz (timer 2 - 40usec to 1.5 msec delay for writing to the LCD screen) and 7.8kHz (timer 3 - .5 second delay for screen refresh).

The onboard ADC runs at 62.5 kHz giving temperature and power measurements 1,250 times per second. After the reading the temperature is converted to Fahrenheit (hex) and the power is converted to volts (hex). When the menu processes the information for display it converts the values to ASCII. Otherwise they are stored in hex for easier computation.

The UART communication to the AVR Raven module is through a serial port and is completely interrupt driven. Commands are processed on the fly and when writing to the Raven it is done through a buffer due to the slow speed of the UART. The packet structure consists of a start byte "0x01" a command and an end of transmission byte "0x02" which is outlined in the function list.

Main Flow Diagram:

Interrupts:

 

Winamp:

 

Touch Buttons: