LPC11C24 I/O Configuration read only?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

LPC11C24 I/O Configuration read only?

跳至解决方案
1,234 次查看
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.

标签 (2)
1 解答
1,155 次查看
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

在原帖中查看解决方案

2 回复数
1,156 次查看
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,155 次查看
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 项奖励