I have been working on a project that requires generation of an accurately timed pulse (2 us to 1 ms) followed by capture of a burst of sequential ADC readings (see below). I am coding in C in MCUXpresso with the EVKMIMXRT1010 evaluation board.
I have code that uses GPIO to drive the pin high, waits in a tight loop, then drives the pin low and triggers the ADC chain, but this puts an unnecessary load on the processor and can be affected by other interrupts. Ideally I would like to initiate the pulse and let the processor handle the data capture using DMA, notifying by interrupt when the array of captured analogue data is complete.
Unfortunately I am falling at the first hurdle. I have looked at both the eFlexPWM and FLEXIO peripherals but I can't get either to generate a timed single pulse (I have generated a sequence of PWM pulses using the example projects, but I can't see how to stop after just one).
Could somebody please advise whether this is possible and if so, the specific peripheral register settings required to set it up?
Many thanks,
Richard
After doing some more reading, I can see that on the RT1011 there is no way to trigger the ADC from the FLEXIO peripheral using the XBARA interface. My proposed solution is therefore to use a PIT to generate the pulse, turn off the pulse in the PIT interrupt and start the ADC conversions from there.
Hi @Gavin_Jia ,
Thanks for your reply. I was thinking some more about this and I wondered if I could use the FLEXIO peripheral. Using one timer, one shifter and one output pin, is it possible to set up a one-bit transfer?
Using AN12174 as an example, set the shifter and timer as below:
Do you think this would work?
Many thanks,
Richard
Hi @RickyCoder ,
Thanks for your interest in NXP MIMXRT series!
As far as I know, the FlexPWM module is not suitable for such operation, if your goal is to trigger the ADC with PWM, you can refer to the implementation in this document, which guarantees a reliable conversion by configuring Val4/5 to trigger the ADC.
Best regards,
Gavin