How to generate accurate pulse on i.MX RT1011 and chain to ADC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to generate accurate pulse on i.MX RT1011 and chain to ADC

237件の閲覧回数
RickyCoder
Contributor I

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.

Timing.jpg

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

 

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

123件の閲覧回数
RickyCoder
Contributor I

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.

0 件の賞賛
返信

169件の閲覧回数
RickyCoder
Contributor I

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:

RickyCoder_0-1757343224327.png

Do you think this would work?

Many thanks,

Richard

0 件の賞賛
返信

179件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

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

 

 

0 件の賞賛
返信