LPC11C24 I/O Configuration read only?

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

LPC11C24 I/O Configuration read only?

ソリューションへジャンプ
729件の閲覧回数
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 解決策
650件の閲覧回数
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 返答(返信)
651件の閲覧回数
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

650件の閲覧回数
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 件の賞賛