This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can' t configure ADC of LPC935!

Hi,

I'm using LPC935 and I want to set the built in AD converter.
I have to use P0.0 pin, so I have written the following code (The pin is configured as input only):

void InitADC()
{

ADCON0 = 0x45; //Enable ADC0 and Interrupt on conversion done
//Single mode
ADMODA = 0x01;
//Freq div
ADMODB = 0x40; //CCLK/3

//Select P00
ADINS = 0x01; //Enable P00 input

EAD = EA = 1; //Enable IRQ


}

The matter is that even I run this piece of code the ADC settings are still the same.
Even if I play step by step, every line of this routine can't make any modificatione in ADC registers.
What's the matter?

Thanx in advance

Parents
  • Hi,

    when I first enter in the routine and proceed step by step, with the
    "Peripheral-->ADConverter -->ADC0/DAC0" of the ide open,
    for every line that I go through, there aren't changes in the appropriate register,
    for example:
    if before the line:
    ADMODB |= 0x40; (*)

    The ADMOB register is: 0x00

    even after the execution of instruction (*)

    the ADMOB is always 0x00!!!

Reply
  • Hi,

    when I first enter in the routine and proceed step by step, with the
    "Peripheral-->ADConverter -->ADC0/DAC0" of the ide open,
    for every line that I go through, there aren't changes in the appropriate register,
    for example:
    if before the line:
    ADMODB |= 0x40; (*)

    The ADMOB register is: 0x00

    even after the execution of instruction (*)

    the ADMOB is always 0x00!!!

Children