LPC11C24 I/O Configuration read only?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC11C24 I/O Configuration read only?

Jump to solution
1,725 Views
diegobarile
Contributor II

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.

Labels (2)
1 Solution
1,646 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

pastedImage_1.png

View solution in original post

2 Replies
1,647 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

pastedImage_1.png

1,646 Views
diegobarile
Contributor II

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.

0 Kudos
Reply