April
2005, Issue 177
Simple
USB Data Acquisition
DAQ
VIA ARM
In
this simple USB ARM DAQ application, the LPC2138 must
read analog temperature sensor voltage at a timed interval.
The data must be formatted and then sent to the MCB2130
board’s serial port. Therefore, you must use the LPC2138’s
timer peripheral for the interval timer, its A/D peripheral
for reading the analog temperature sensor voltage, and
its UART peripheral for serial communication.
The
LPC2138’s timer is a 32-bit timer/counter with a programmable
32-bit prescaler. It’s an extremely flexible timer given
its capture channels, match registers, external outputs,
and interrupt capabilities. I preloaded a timer match
register for this application. The LPC2138 generates
a timer interrupt when the timer counter matches this
value. Its A/D converter is a 10-bit successive approximation
A/D converter. A 10-bit reading of the analog temperature
sensor provides more than enough resolution for the
USB ARM DAQ example.
The
LPC2138’s UART is your typical UART with data rate generation,
but it also includes 16-byte receive and transmit FIFOs
for added flexibility. Given that temperature data is
sent out every few minutes, the data rate is set to
9,600 bps. Now that you’re familiar with the LPC2138’s
peripherals, let’s move on to the embedded software.