ADC Test & Analog Mode

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

ADC Test & Analog Mode

915 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by woodchuck on Fri Nov 30 15:38:21 MST 2012
In the LPCXpresso library for the LPC1114, there is an ADC.C file.  In the initialization function there is this comment:

[B]"Unlike some other pings, for ADC test, all the pins need to [be] set to analog mode."[/B]

Would anyone know what this means?  Even in the sample program, AD4 is being used as SWDIO, since the target uC is reporting values back to the host via JTAG.

I certainly hope it doesn't mean that to use any analog line, you have to use all of them!
0 项奖励
回复
3 回复数

895 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by woodchuck on Sat Dec 01 11:51:11 MST 2012
Okay.  I see.  ADC_TEST actually reads all available ADC lines.  That's why all are enabled.  I read too much into the comment that "...[B][I]all[/I][/B] pins [B][I]need to be[/I][/B] set..." as though it pertained to any use whatsoever of the ADC facility.

Thanks!
0 项奖励
回复

895 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by graynomad on Fri Nov 30 16:40:36 MST 2012

Quote:
I certainly hope it doesn't mean that to use any analog line, you have to use all of them!


No, you have to select the analogue function in the IOCON register for the pin you want to use analogue on.

On the 1227 that means clearing bit 7.
0 项奖励
回复

895 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Fri Nov 30 15:53:49 MST 2012
UM:

Quote:

The ADC function must be selected via the IOCON registers in order to get accurate voltage readings on the monitored pin. For a pin hosting an ADC input, it is not possible to have a have a digital function selected and yet get valid ADC readings. An inside circuit disconnects ADC hardware from the associated pin whenever a digital function is selected on that pin.


Of course you can switch each pin to ADC :eek:
0 项奖励
回复