ADS1232 firmware
================
This firmware is written using FreeRTOS (www.freertos.org).
There are four tasks:
- Core - priority 0 (lowest)
- Controls LCD
- Responds to switch presses
- Runs menus etc.
- Performs ASCII conversion of results
- Analysis - priority 1
- Retrieves device data
- Performs analysis on device data
- Does averaging, noise analysis
- Comm - priority 1
- Runs the serial protocol
- Also retrieves device data
- Handles commands etc., runs a console
- Keys - priority 2
- Reads key switches
- Debounces
- Places scanned keys on a queue, read by Core
There is another task called Test that runs in place of Core when the test mode is entered at powerup. It does the same things as Core, but runs the test procedure.
There are three ISRs:
- ADC
- Reads code from ADC
- Delivers it to Analysis
- Serial in
- Retrieves characters from the serial port
- Serial out
- Sends chars to the serial port
Serial protocol
---------------
The serial protocol can be used over a terminal program like HyperTerm. Communication is over USB-serial using the TI virtual COM port driver. Format is 8N1, no flow control, 115200 baud.
Commands consist of one letter and end with a line feed. Carriage returns are ignored. Commands are case insensitive. If an error occurs, a '?' is returned followed by a descriptive message. Command prompt is "ADS>".
Commands are:
- P[0-3] - set PGA bits. 0 = gain of 1, 1 = gain of 2, 2 = gain of 64, 3 = gain of 128
- R[F,S] - data rate. Fast or Slow
- O[E,I] - clock, external or internal
- C[0-2] - channel 0, 1, or 2 (2 = temperature)
- V - show firmware version & copyright notice
- S - start retrieving data. Data comes out as 6-digit hex codes separated by CR+LF. Stop the stream by sending any byte.
- D - read one piece of data
- Q - query parameters. Returns 'P[0-3]R[F,S]O[E,I]C[0,1,2]<CR><LF>'
- K - run calibration