lpc55s28 adc0_12 not working

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

lpc55s28 adc0_12 not working

Jump to solution
4,638 Views
PatrickLai
Contributor III

Hi,

I'm configuring ADC0_3 and ADC0_12 for LPC55S28. ADC0_3 can get different values for different input voltages, but ADC0_12 always gets 4092~4095 for any input voltages. Please help to check what is the possible cause of this issue. Attached my current changes for ADC

Best regards,

Patrick

0 Kudos
Reply
1 Solution
1,875 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @PatrickLai 

I'm sorry for the late reply. I’m not sure why our internal system didn’t send me a notification when you updated this thread.

Anyway, I have tested your project and checked the issue. The problem is that ADC0_12 corresponds to channel (ADCH) 4, not 12. So please change
#define DEMO_LPADC_USER_CHANNEL 12U
to
#define DEMO_LPADC_USER_CHANNEL 4U.

Also, please configure the sample channel mode to "Single-ended mode, as only the B-side channel is converted" . As shown below.

Alice_Yang_0-1768373641678.png

 

After these changes, it works correctly.

Alice_Yang_1-1768373677726.png

 

 

Hope it helps. 

Thank you.

 

BR

Alice

 

View solution in original post

0 Kudos
Reply
11 Replies
4,613 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @PatrickLai 

Please check your hardware to verify whether ADC0_12 is connected to a high voltage on the board. Also, please confirm that you are connected to the correct pin.
Thank you.
 
BR
Alice
0 Kudos
Reply
4,556 Views
PatrickLai
Contributor III
Hi Alice,
I've tested the input voltage of ADC0_12 pin on the MCU is 1.9V, so the hardware should be ok. but the adc value is still in range of 4091 and 4095
0 Kudos
Reply
4,542 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @PatrickLai 

 

Please connect GND for testing.
If the issue persists, use the configuration tool to set up the ADC and this channel.

 

BR

Alice

0 Kudos
Reply
2,558 Views
PatrickLai
Contributor III

Hi Alice,

I connected to ground and the adc value is still not right. I have trouble using config tool to setup adc. So I used the sample code lpadc_polling from the SDK. I only change the ADC channel to ADC0_12 and it still doesn't work. The ADC0_3 is ok. Could you please help to check based on the sample code and my configuration?

0 Kudos
Reply
2,379 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @PatrickLai 

Do you use the LPCXpresso55S28-EVK board? If yes, please check the schematic; this pin is connected to VDD.
Alice_Yang_0-1767602873934.png

 

BR

Alice

 

 
0 Kudos
Reply
2,376 Views
PatrickLai
Contributor III

Hi Alice,

I tested on the evk, and tried removing the R75 and press the USER button(SW3), adc value is still the same, around 4094~4095. Please help to check again.

Best regards,

Patrick

0 Kudos
Reply
2,373 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @PatrickLai 

Please share your complete project.
 
BR
Alice
0 Kudos
Reply
2,370 Views
PatrickLai
Contributor III

Hi Alice,

project code uploaded.

Best regards,

Patrick

0 Kudos
Reply
2,243 Views
PatrickLai
Contributor III
Hi @Alice_Yang ,
Any udpate?
Best regards,
Patrick
0 Kudos
Reply
1,876 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @PatrickLai 

I'm sorry for the late reply. I’m not sure why our internal system didn’t send me a notification when you updated this thread.

Anyway, I have tested your project and checked the issue. The problem is that ADC0_12 corresponds to channel (ADCH) 4, not 12. So please change
#define DEMO_LPADC_USER_CHANNEL 12U
to
#define DEMO_LPADC_USER_CHANNEL 4U.

Also, please configure the sample channel mode to "Single-ended mode, as only the B-side channel is converted" . As shown below.

Alice_Yang_0-1768373641678.png

 

After these changes, it works correctly.

Alice_Yang_1-1768373677726.png

 

 

Hope it helps. 

Thank you.

 

BR

Alice

 

0 Kudos
Reply
1,791 Views
PatrickLai
Contributor III

Hi Alice,

It works now. Thank you for your help.

Best regards,

Patrick

0 Kudos
Reply