Dear all.
I'm struggling with one unknown behavior on my LPC11C24.
I'm trying to run the ADC to convert the voltage on AD0 pin, but even if the source code should be right (I catched it from several examples) the conversion returns always zero.
After a deep check the problems seems to be related to the pin configuration: even if i run the following code:
Chip_IOCON_PinMuxSet(LPC_IOCON, IOCON_PIO0_11, FUNC2);
The memory related to the I/O Configurations is always zero.
If I try to write the value directly with LPCXpresso peripherals view it doesn't change.
If I write 0x02 in edit mode when I press enter the memory returns 0x00. Please see the attached image.
If I not change this value than means that this I/O is not configured as analog input.
This could explain why the ADC always converts 0.
What I wrong or missing?
Thanks in advance.
Diego.
Solved! Go to Solution.
Hi, Diego,
Pls check if you enable the gated clock of IOCON module.
SYSCON->AHBCLKCTRL|=1<<16;
Pls refer to the SYSAHBCLKCTRL reg in UM10398.pdf.
Hope it can help you
BR
XiangJun Rong
Hi, Diego,
Pls check if you enable the gated clock of IOCON module.
SYSCON->AHBCLKCTRL|=1<<16;
Pls refer to the SYSAHBCLKCTRL reg in UM10398.pdf.
Hope it can help you
BR
XiangJun Rong
Hi XiangJun.
The problem was exactly here. Setting this bit has solved the issue.
Now the IOCON section can be set and the ADC runs properly.
Thank you so much. :-)
Best regards.
Diego.