Trigger ADC1 and ADC2 simultaneously with Software

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

Trigger ADC1 and ADC2 simultaneously with Software

156 Views
Ruthrapathy_K
Contributor I

Hello,

I am using MKE18F512VLL16 microcontroller. I have configured ADC1 and ADC2 modules to sample different pins. Right now, I trigger the conversion 1 by 1. i.e. Start ADC1 conversion by writing SC1 of ADC1 and next writing SC1 of ADC2 and wait till both the conversions are completed. But the problem here is I am triggering ADCs one by one. I need to trigger both ADC conversion simultaneously and that trigger should be a software.

I attempted to use TRGMUX peripheral like below

1. Select SIM_SW_TRIG as input source for TRGMUX1 and output that Signal to TRGMUX0.

2. I selected EXTRG0, ADC1 and ADC2 module's trigger source as TRGMUX0's output. 

3. I routed the EXTRG0 output to pin PTE16 and that pin is working as per the expectation when I write to SIM->MISCTRL register.

But ADC1 and ADC2 are not triggered. I confirmed it by putting the breakpoint inside the Conversion complete interrupt and it is not hit.

I need inputs on how I can achieve the requirement of simultaneous sampling. Please support ASAP as this is a time critical project for the company

0 Kudos
Reply
1 Reply

120 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Ruthrapathy_K,

As mentioned on the following post: K66 Teensy 3.6 ADC Simultaneous Data Read Process - NXP Community, you can use PDB to trigger ADC0 with PDB CH0, and ADC1 with PDB CH1. The following training material explains the usage of PDB, its functionality, and how to set it up: PDB for Kinetis K Series MCUs | Training - PDF

BR,
Edwin.

0 Kudos
Reply