iMXRT: ADC_ETC measurements sporadic

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

iMXRT: ADC_ETC measurements sporadic

708 Views
Sam_ECU
Contributor V

Hello,

I'm working with the imxrt1062 and trying to measure 7x pins on ADC1 and 6x pins on ADC2 using ADC_ETC.

I've tried to follow the info here but haven't managed to resolve my issue:
https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Trigger-ADC-with-PWM-on-IMX1064/td-p/1273086
https://www.nxp.com/docs/en/application-note/AN12214.pdf
https://community.nxp.com/t5/i-MX-Processors/ADC2-and-ADC-ETC-not-working-rt1024-evk/m-p/1336318
https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/ADC-ETC-sync-mode-questions-on-rt1050/m-p/844735

My issue is that several pins measure only noise (ADC2: Sens_CoolTemp, Sens_Spare & ADC1: Lam_Nernst_V (not in the screenshot)):

Sam_ECU_0-1729082916956.png

I can measure at the pins using a multimeter and they're a stable 3.3V.  I can measure the incorrect pins with a neighbouring ADC (eg. Fuel_Level) and the values are correct.  I can flash the code to the EVKB_1062 and see the same issue on the same channels so I'm sure that the issue isn't in the hardware.

My setup with the best results are:
ADC1:

Sam_ECU_1-1729083137530.png


ADC2:

Sam_ECU_2-1729083163093.png


ADC_ETC:

Sam_ECU_3-1729083201664.pngSam_ECU_4-1729083216353.png


I see no improvement or no measurements at all if I:
- ADC2: Set Trigger source to CH1_XBAR_TRG0 (Trigger Group 4)
- Remove "Bypass TSC"
- Change my PIT_Timer (1ms, 10ms, 100ms)
- Remove Back2Back and set delays and intervals
- Set ADC1_Channels as all Group 0 and ADC2_Channels as Group 1
- Change priorities
- Set up sync mode with ADC1 and Trigger Group 0 and ADC2 as Trigger Group 4

Attached my peripherals.c.

What am I missing? How can the issue be fixed to measure correctly all ADC1 and ADC2 channels.

0 Kudos
Reply
4 Replies

646 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Sam_ECU ,

Thanks for your interest in NXP MIMXRT series!

It's hard to pinpoint the problem directly from within your description alone. Which channels are you referring to that are not getting the expected results? What if these channels are tested individually? Also, it would be good to suggest a minimum replication project for me to test and try. 

Best regards,
Gavin

0 Kudos
Reply

562 Views
Sam_ECU
Contributor V

Hello @Gavin_Jia 

Sorry for the delay.

It's hard to pinpoint the problem directly from within your description alone. Which channels are you referring to that are not getting the expected results?
- In this example, ADC2.IN.1 and ADC2.IN.2.

What if these channels are tested individually?
- When previously tested, ADC_Polling, rather then ADC_ETC delievered the expected results

Also, it would be good to suggest a minimum replication project for me to test and try. 
- Please find attached .axf/bin, my exported project from Embedded Coder, .mex and and cutout from the ADC_ETC code from my main program (Oiida.c).

You can flash the .axf to the 1060-EVK and you can measure the problem I see.  Freemaster file also in the zip.

Thanks for the help;
Sam

0 Kudos
Reply

488 Views
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @Sam_ECU ,

Sorry for the late reply, our team has a huge backlog lately.

I only have MCUXpresso environment here may not be able to run your project directly. But your requirement is clear to me, controlling ADC2_CH1 and ADC2_CH2 via ADC_ETC works right?

Please refer to this evkmimxrt1060_adc_etc_hardware_trigger_conv demo in the SDK, it is exactly the same as your requirement, using CH0 and CH15 of ADC1, you just need to simply change the pin configuration to port it to your project.

Best regards,
Gavin

0 Kudos
Reply

419 Views
Sam_ECU
Contributor V

Hello @Gavin_Jia 

That's exactly the problem.  I took the SDK (but for MBDT) and ported it to my pins.

When I flash to my board and to the EVK some channels measure inconsistently.  The setup is essentially the SDK.

0 Kudos
Reply