Some Adc channels always returning 0

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

Some Adc channels always returning 0

Jump to solution
1,810 Views
AnthonyPinard
Contributor I

Hello all, 

I am using S32K312, RTD 2.0.3 and Tresos 29.0.0

I have a problem with the ADC module. Currently, Adc0 is SW triggered and Adc1 is triggered by the BCTU. Everything works great except for a small detail.... two channels of the Adc0 instance are always returning 0.

Six of the eight channels are returning perfectly coherent values while channels S8 and S9 always read 0 when there is in fact a voltage applied on their pin. (confirmed with scope) The NCMR1 register reads 0x0000_047B, which means the concerned channels are supposed to be converted. The 8 channels are in the same group, and they are all configured the same way. The pins are all configured as the right Adc channel.

I tried triggering Adc0 by Hw and with the BCTU, but it did not help my cause. I also tried shutting off Adc1 to see if it was interrupting Adc0. Finally, I tried triggering only the two problematic channels but, they still read 0.

Any idea what could be causing this issue? 

 

Thanks,

0 Kudos
Reply
1 Solution
1,795 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Which two pins do you connect the analog signals of ADC0 S8 and S9 to? There is a bug in RTD 2.0.x that may cause this problem. Please see the discussion here: S32K312 - ADC Problem


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
3 Replies
1,796 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

Which two pins do you connect the analog signals of ADC0 S8 and S9 to? There is a bug in RTD 2.0.x that may cause this problem. Please see the discussion here: S32K312 - ADC Problem


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply
1,783 Views
AnthonyPinard
Contributor I

Hi Robin, 

The two channels are PTA0 and PTA1. However, I noticed that the channels are triggering on pins PTB13 and PTB14, which are configured as GPIOs. 

Is it because ADC0_S8 and ADC0_S9 are supposed to be only available through the port B and not port A?

Thanks

0 Kudos
Reply
1,758 Views
Robin_Shen
NXP TechSupport
NXP TechSupport
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1902816%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ESome%20Adc%20channels%20always%20returning%200%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1902816%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20all%2C%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20using%20S32K312%2C%20RTD%202.0.3%20and%20Tresos%2029.0.0%3C%2FP%3E%3CP%3EI%20have%20a%20problem%20with%20the%20ADC%20module.%20Currently%2C%20Adc0%20is%20SW%20triggered%20and%20Adc1%20is%20triggered%20by%20the%20BCTU.%20Everything%20works%20great%20except%20for%20a%20small%20detail....%20two%20channels%20of%20the%20Adc0%20instance%20are%20always%20returning%200.%3C%2FP%3E%3CP%3ESix%20of%20the%20eight%20channels%20are%20returning%20perfectly%20coherent%20values%20while%20channels%20S8%20and%20S9%20always%20read%200%20when%20there%20is%20in%20fact%20a%20voltage%20applied%20on%20their%20pin.%20(confirmed%20with%20scope)%20The%26nbsp%3BNCMR1%20register%20reads%200x0000_047B%2C%20which%20means%20the%20concerned%20channels%20are%20supposed%20to%20be%20converted.%20The%208%20channels%20are%20in%20the%20same%20group%2C%20and%20they%20are%20all%20configured%20the%20same%20way.%20The%20pins%20are%20all%20configured%20as%20the%20right%20Adc%20channel.%3C%2FP%3E%3CP%3EI%20tried%20triggering%20Adc0%20by%20Hw%20and%20with%20the%20BCTU%2C%20but%20it%20did%20not%20help%20my%20cause.%20I%20also%20tried%20shutting%20off%20Adc1%20to%20see%20if%20it%20was%20interrupting%20Adc0.%20Finally%2C%20I%20tried%20triggering%20only%20the%20two%20problematic%20channels%20but%2C%20they%20still%20read%200.%3C%2FP%3E%3CP%3EAny%20idea%20what%20could%20be%20causing%20this%20issue%3F%26nbsp%3B%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThanks%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1905189%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Some%20Adc%20channels%20always%20returning%200%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1905189%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ENo.%20This%20may%20caused%20by%20the%20bug%20of%20RTD%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K344-ADC-HAS-ADC-INTERLEAVE-problem%2Fm-p%2F1548855%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K344-ADC-HAS-ADC-INTERLEAVE-problem%2Fm-p%2F1548855%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1904359%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Some%20Adc%20channels%20always%20returning%200%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1904359%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Robin%2C%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20two%20channels%20are%20PTA0%20and%20PTA1.%20However%2C%20I%20noticed%20that%20the%20channels%20are%20triggering%20on%20pins%20PTB13%20and%20PTB14%2C%20which%20are%20configured%20as%20GPIOs.%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20because%20ADC0_S8%20and%26nbsp%3BADC0_S9%20are%20supposed%20to%20be%20only%20available%20through%20the%20port%20B%20and%20not%20port%20A%3F%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1903211%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Some%20Adc%20channels%20always%20returning%200%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1903211%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%3C%2FP%3E%0A%3CP%3EWhich%20two%20pins%20do%20you%20connect%20the%20analog%20signals%20of%20ADC0%20S8%20and%20S9%20to%3F%20There%20is%20a%20bug%20in%20RTD%202.0.x%20that%20may%20cause%20this%20problem.%20Please%20see%20the%20discussion%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K%2FS32K312-ADC-Problem%2Ftd-p%2F1700777%22%20target%3D%22_self%22%3ES32K312%20-%20ADC%20Problem%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3ERobin%3CBR%20%2F%3E-------------------------------------------------------------------------------%3CBR%20%2F%3ENote%3A%3CBR%20%2F%3E-%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22Mark%20Correct%22%20button.%20Thank%20you!%3C%2FP%3E%0A%3CP%3E-%20We%20are%20following%20threads%20for%207%20weeks%20after%20the%20last%20post%2C%20later%20replies%20are%20ignored%3CBR%20%2F%3EPlease%20open%20a%20new%20thread%20and%20refer%20to%20the%20closed%20one%2C%20if%20you%20have%20a%20related%20question%20at%20a%20later%20point%20in%20time.%3CBR%20%2F%3E-------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E