I have this code for the ADC in burst mode. The ISR is called
continually, but I don't see a value for the result. Gurus enlighten
me, what am I doing wrong?
#include <lpc21xx.h>
void AD_ISR (void) __irq
{
unsigned val,chan;
static unsigned result[8];
val = ADDR;
chan = ((val >>0x18) & 0x07);
val = (val >> 6) & 0x03FF; //Extract the A/D result
result[chan] = val;
VICVectAddr = 0; //clear the IRQ function address
}
int main(void)
{
PINSEL1 = 0x003FF000;
PINSEL0 = 0x03F00000;
ADCR = 0x00270204; // Setup A/D: 10-bit AIN0 @ 4.2MHz
VICVectCntl0 = 0x00000032; //connect A/D to slot 0
VICVectAddr0 = (unsigned)AD_ISR; //pass the address of the IRQ
into the VIC slot
VICIntEnable = 0x00040000; //enable interrupt
while(1)
{
;
}
}Message
No result for ADC in burst mode
2006-02-01 by scrappystuff64
Attachments
- No local attachments were found for this message.