Synchronize Channels of Quad Timer on i.MX

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

Synchronize Channels of Quad Timer on i.MX

368件の閲覧回数
aberger
Contributor V

It should be possible to synchronize multiple channels of a Quad Timer (TMR) module on the i.MX RT1050 by writing multiple bits to the TMRx_ENBL register (see Section 53.11.14 of the RM).

I am working with the SDK_2.x_EVKB_IMXRT1050. It only provides memory-mapped access to the TMR registers (via the `TMR_Type`) at the CHANNEL level, so an atomic write to the ENBL register to enable multiple channels simultaneously is not possible with the `TMR_Type` typedef.

As a concrete example, I would like to enable Channels 0 and 1 of TMR3 simultaneously. This should be possible with something like `TMR3->ENBL = 3U;`. I think that the current implementation, where ENBL is part of the CHANNEL struct (and so is accessed at 4 locations in the `TMR_Type` struct), is not arranged properly.

0 件の賞賛
返信
3 返答(返信)

357件の閲覧回数
mayliu1
NXP Employee
NXP Employee

Hi @aberger ,

Thank you so much for your interest in our products and for using our community.

Regarding "It should be possible to synchronize multiple channels of a Quad Timer (TMR) module on the i.MX RT1050 by writing multiple bits to the TMRx_ENBL register (see Section 53.11.14 of the RM)."

Yes, your understanding is correct, Multiple ENBL bits can be set at the same time to synchronize the start of separate counters.

mayliu1_1-1752132941631.png

As for “As a concrete example, I would like to enable Channels 0 and 1 of TMR3 simultaneously. This should be possible with something like `TMR3->ENBL = 3U;`. I think that the current implementation, where ENBL is part of the CHANNEL struct (and so is accessed at 4 locations in the `TMR_Type` struct), is not arranged properly.

Please pay attention that TMRx_ENBL register default value is 1, it means 0001b - Timer channel is enabled. (default).

So if you want realize  enable Channels 0 and 1 of TMR3 simultaneously, first, you need clear TMRx_ENBL(TMR3->ENBL = 0U ,disable  Channels 0 and 1 ).   After all the TMR configuration, then you can set  `TMR3->ENBL = 3U. 

The SDK provides basic drivers. However, if customers need to implement more complex driver functions, they can add the required code as needed.

Wish it helps you.
If you still have question about it, please kindly let me know.

Wish you a nice day!

Best Regards
MayLiu

0 件の賞賛
返信

332件の閲覧回数
aberger
Contributor V

Thank you @mayliu1. In general if issues or shortcomings are discovered with the SDK, is there a better place to report them (e.g. submit an issue to a GitHub repository)?

0 件の賞賛
返信

318件の閲覧回数
mayliu1
NXP Employee
NXP Employee

Hi @aberger ,

Thanks for your updated information.

I will create an internal ticket to relevant NXP team for your inquire.

Thanks for your raising this question.

Best Regards

MayLiu

0 件の賞賛
返信