when iam writing the program for adc it is executed. But iam trying to do in debug session it showing disassembly. plz help me where I can do the mistake.my program is
#include <LPC214X.H> #include <stdio.h> void init_UART0(void); void init_ADC0_1(void); void ADC_read(void); int main() { int value; VPBDIV=0X02; init_UART0(); init_ADC0_1(); { U0THR=value; printf("adcvalue=%d",value); } }
void init_ADC0_1(void) {
PINSEL1=0X01000000; PCONP=0X00001008; AD0CR=0X00000001; AD0CR=0X00000600; AD0CR=0X00070000; AD0CR=0X00100000; } void ADC_read(void) { int value=0; AD0CR=0X01000000; while(value&(0x80000000)==0); value=AD0GDR; value=((AD0GDR>>6)); value&=0x3ff; AD0CR=~(0X01000000); } void init_UART0(void) { PINSEL0=0X00000005; U0LCR=0X00000083; U0DLL=0X000000c3; U0LCR=0X00000003; U0FCR=0X00000007; }
You look like your being way too ambitious.
Try to get an LED flashing first. Understand where your have a fundamental error in what you're doing.
Only after that consider your ADC.