How to use multiple inputs/Channels of ADC S32K148-EVB

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

How to use multiple inputs/Channels of ADC S32K148-EVB

3,603 Views
Kallappa
Contributor III

Hi,

I am working on S32K148-EVB, where i am able use the Single channel/input from sensor using ADC0 (example code adc_swtrigger_s32k148 from NXM community) and now i want to read multiple sensor data using ADC0 with different channels/inputs for this i have tried this by configuring ADC converter with one more ADC channel  and the result is

  1. Pin PTC14 --> channel12 is reading data but it is constant (This configured in NXP ex code)
  2.  One more pin PTC3 --> channel11 is not reading data from sensor(This configured by me in Example code)

    so how i can read the multiple channels kindly let me know 
    code i am using is attached here for reference

    and i have one more query here
    * with the NXM example code if i want to read the ADC input with other pins how i can achieve this(As i have tried to change channel number in macro but didn't worked for me)



    Thanks
    Kallappa
0 Kudos
7 Replies

3,584 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

use HW triggered mode. You can find demo example for it in S32DS too, just modify it and add channels you need.
You can also refer to https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-PDB-ADC-DMA-S32DS-ARM-2018-R1/ta-p/...

BR, Petr

0 Kudos

3,582 Views
Kallappa
Contributor III

Hi PetrS,

Thank you for your response, i will check with HW triggered mode

and the link you shared for reference, from that i have downloaded the zip file but it is empty, please share me the file again if possible it will be really helpful

Best regards,
Kallappa

0 Kudos

3,570 Views
Kallappa
Contributor III

Hi PetrS,

Can you please tell about this,

* with the NXM example code if i want to read the ADC input with other pins how i can achieve this(As i have tried to change channel number in macro but didn't worked for me)
in example code : As ADC data is reading from input/channel-12 from ADC0 i.e PTC14 

so if want to read ADC data from some other pin like PTC19 or any other

Please let me about this 

Thanks & regards,
Kallappa

0 Kudos

3,557 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

what is NXM example?
If checking SDK adc_swtrigegr_s32k148 demo example chanell 28 is converted (PTC28 pin, connected with potentiometer on EVB). So value 0x2C is written to SC1A register. Refer to SC1A[ADCH]  description in the RM.

BR, Petr

0 Kudos

3,574 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

strange, I see it is not empty when download it.
Anyway see attached.

BR, Petr

0 Kudos

3,539 Views
Kallappa
Contributor III

Hi PetrS,

Thanks for sharing the code,

I am able to read the analog voltage from deferent pins at a time with adc_hwtrigegr_s32k148 demo example(1 sensor output on different ADC0 channel PTC14 or PTC19 one at a time) but when i tried to read two different sensor output on ADC0 channel PTC14(Sensor1) and PTC19(Sensor2) i am not getting sensor data on any of the pin i have attached code here, kindly let me know where i am doing wrong 

and the code shared (S32K144_PDB_ADC_DMA_sdk_rtm_300.zip) is using DMA, Timers etc so it is quite difficult understand so please let me what is problem here

Thanks,
Kallappa

0 Kudos

3,532 Views
Kallappa
Contributor III

Hi PetrS,

Actually i am trying this ADC0 with multi channel in S32K148,
and now i am porting S32K144_PDB_ADC_DMA_sdk_rtm_300 and i will check how this works


Thanks,
Kallappa

0 Kudos