How to setup eTimer to trigger ADC conversion on MPC5744P

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

How to setup eTimer to trigger ADC conversion on MPC5744P

2,685件の閲覧回数
VladiKn
Contributor III
Hello, Is there any example on how to do this? I have gone through all the documents that I have for the MPC5744P but couldn't find any example. It's only mentioned in the reference manual that it can be done. Cheers, Vladimir
0 件の賞賛
返信
6 返答(返信)

2,667件の閲覧回数
VladiKn
Contributor III

Hi,

I have initialized both the ADC and the eTimer and they run independently but I haven't managed to make a connection between them. I use ADC1 with CTU disabled and in Injected mode, and eTimer0 CH5. When I was using the ADC without the eTimer I used the EOC interrupt to gather the converted data. Do I use the eTimer interrupt in this case? Or is there another way to gather data?

Cheers,
Vladimir

0 件の賞賛
返信

2,658件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as I wrote eTimer1 ch5 is conencted to ADC0 and ADC1 as external trigger, so if using eTimer0 it will not work. 
Same interrupt will be called if ADC_IMR[MSKJEOC] is set.

BR, Petr

0 件の賞賛
返信

2,641件の閲覧回数
VladiKn
Contributor III

Hi,

Thanks for the replies. Yes, eTimer1 was used but when I wrote the answer I put 0 by mistake.
After I set the MSKJEOC bit I get the EOC interrupt but only once. I've noticed that the TCF (and TCF1) flag of the eTimer is set and I assume that's what triggers the conversion. But when I try to clear the TCF flag in the STS register it doesn't work and it is constantly set to 1. Do you know what could be the issue?

Thanks,
Vladimir

0 件の賞賛
返信

2,625件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

TCF is set when a successful compare occurs, it is cleared by writing 1 to this bit.
So probably counter is running and bit is set again.
The OFLAG signal is taken as external trigger to ADC.

BR, Petr 

0 件の賞賛
返信

2,622件の閲覧回数
VladiKn
Contributor III

Hi,

Thanks for the info. I had the OFLAG set to Software controlled. When I set it to toggle on compare it works!

Cheers!

0 件の賞賛
返信

2,680件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

if the ADC is in CTU mode, then you can use eTimer to trigger CTU, you can refer to below code
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/Example-MPC5744P-eTimer-CTU-ADC-synchronization-...

If the ADC is not in CTU mode, then eTimer can directly trigger conversion. eTimer channel 5 acts as external trigger for ADC module and injection trigger should be enabled in ADC (JTRGEN bit). Using JCMR0 you select which channels will be sampled/converted after this external trigger happens. The eTimer1 ch5 is connected to ADC0 and ADC1, and the eTimer2 ch5 is connected to the ADC2 and ADC3 modules.

BR, Petr

0 件の賞賛
返信