VICVectAddr In LPC17xx.h

Questions about the BASICtools and MakeItC
danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: VICVectAddr In LPC17xx.h

Post by danlee58 »

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.



danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: VICVectAddr In LPC17xx.h

Post by danlee58 »

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.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: VICVectAddr In LPC17xx.h

Post by basicchip »

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...

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: VICVectAddr In LPC17xx.h

Post by danlee58 »

Why not just #include "adc.h" and call initAD() and AD(x) ??
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.

Post Reply