205
Sensing Multiple Out-of-Sequence ADC10 Channels with DMA
Due to several obligations and design constrains, we may often fall in situations where we would not
be able to enjoy the sequential DTC-assisted ADC scanning feature demonstrated in the previous
section. ADC channels may not be in an orderly sequence. Still we can apply similar techniques as in
ADC scanning but certain things are needed to be kept in mind in such cases.
Code Example
#include <msp430.h>
#include "delay.h"
#include "SW_I2C.h"
#include "PCF8574.h"
#include "lcd.h"
#define no_of_channels 12
unsigned int ADC_value[no_of_channels];
void GPIO_graceInit(void);
void BCSplus_graceInit(void);
void ADC10_graceInit(void);
void System_graceInit(void);
void WDTplus_graceInit(void);
void lcd_print(unsigned char x_pos, unsigned char y_pos, unsigned int value);
void main(void)
{
/* Stop watchdog timer from timing out during initial start-up. */
WDTCTL = WDTPW | WDTHOLD;
/* initialize Config for the MSP430 GPIO */
GPIO_graceInit();
/* initialize Config for the MSP430 2xx family clock systems (BCS) */
BCSplus_graceInit();
/* initialize Config for the MSP430 10-bit Analog to Digital Converter (ADC)
*/
ADC10_graceInit();
/* initialize Config for the MSP430 System Registers */
System_graceInit();
/* initialize Config for the MSP430 WDT+ */
WDTplus_graceInit();
LCD_init();
LCD_clear_home();