I don’t know if it is possible but i’m trying to read (just for training) the analog pin AN0 through Register class.
Register regPowerControl = new Register(LPC23xx.PCONP);
Register regPeripheralClock = new Register(LPC23xx.PCLKSEL0);
Register regADControl = new Register(LPC23xx.AD0_BASE_ADDR);
Register regAD0 = new Register(LPC23xx.AD0DR0);
Register regResult = new Register(LPC23xx.AD0GDR);
regADControl.Write(18940417); //1 0010 0001 0000 0010 0000 0001
string str = " Power Control= " + regPowerControl.Read() +
" Peripherial Clock= " + regPeripheralClock.Read() +
" Result=" + regResult.Read().ToString() +
" ADC0= " + regAD0.Read().ToString() + " \r\n";
//Power Control= 4078991354 Peripherial Clock= 1048576 Result=3221225472 ADC0= 3221227520
I am always getting the same value in ADC0 Register = 3221227520 with OVERRUN bit = 1 (I have a LDR connected to this pin AD0), What could I be doing wrong?.
Joaquin Pelayo.