While I was taking a shower this AM, I realized what is causing the problem. I have to power the ADC before I can set the ADC Control register. My code was trying to set the ADC Control register before the ADC was powered.
I can set & read back 0x00210134, to enable AD2, AD4, & AD5 in Burst Mode. I set the APB Divider so it will divide the PCLK by 2. That should give me a 12.5 MHz clock for the AD Converters.
I'll download & try to read the ADC Control register in Csample to see how it's set.
VICVectAddr In LPC17xx.h
Re: VICVectAddr In LPC17xx.h
In Csample the ADC Control register is set to 0x00200000. There are no ADs selected, and the APB clock is the same as PCLK. Burst Mode is not selected.
Re: VICVectAddr In LPC17xx.h
Did you actually do an AD conversion (case 30) in Csample.c ??
Why not just #include "adc.h" and call initAD() and AD(x) ??
That's what we use...
Why not just #include "adc.h" and call initAD() and AD(x) ??
That's what we use...
Re: VICVectAddr In LPC17xx.h
That would have been the easy way to do it, but I have it working. I tested all of my IO opertions, my DAC output, and 3 A/D conversions.Why not just #include "adc.h" and call initAD() and AD(x) ??