ADC pin config question

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

ADC pin config question

1,065 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by avass on Tue Jan 22 02:04:08 MST 2013
I'm reading the 1115's ADs and what I found is that if I configure the pins, say PIO0_11 with zeroing out FUNC/MODE ( since HYS and OD has no effect ) :
LPC_IOCON->R_PIO0_11&= ~0x9F;
LPC_IOCON->R_PIO0_11|= 0x2; // AD0 : Analog Input Mode
I get readings in the 0-1023 range, which is expected.

On the other hand, if I set pull-up resistor enabled with
LPC_IOCON->R_PIO0_11|= 0x12;// AD0 : Analog Input Mode/Pull-up resistor enabled
I get readings in the 7-1023 range...

I thought the specs say that HYS and MODE have no effect on ADs (7.3.4).

So, how come?!!! What am I setting / not setting right?!

Thx.
Labels (1)
0 Kudos
Reply
4 Replies

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by avass on Sat Feb 02 10:14:24 MST 2013
Got it, thank you.
0 Kudos
Reply

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wouter on Tue Jan 29 04:09:24 MST 2013
Hi,

I just checked the software I used for testing, and see there was an error in it. I just tried it again, and now see the same behavior as you described.

Apparantely both the MODE and HYS bits do have an effect in analog mode. Therefore, I advise you to clear these bits. I'll submit a change request to updat the user manual.

Regards,
Wouter
0 Kudos
Reply

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by avass on Fri Jan 25 21:34:04 MST 2013
Yes, when I connect to GND, the value is 6~7...
I'm using the LPCXpresso LPC1115 RevA board.
Is this a known feature or a "bug"?
0 Kudos
Reply

1,051 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Wouter on Thu Jan 24 03:50:54 MST 2013
Hi,

The HYS and MODE values should have no effect when using the ADC.

When you get reading only between 7-1023, does that include when you connect the ADC pin straight to GND?
And what board are you using?
Can you share the full SW project?

Regards,
Wouter
0 Kudos
Reply