How to operate i.MX28 TIMROT timer in duty cycle mode?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to operate i.MX28 TIMROT timer in duty cycle mode?

282 Views
sidebranch
Contributor II

Hello,

I would like to use the TIMROT v2 module TIMER3 in duty cycle measurement mode.

As a first test, I just want to measure the duty cycle of the 32 kHz crystal clock.

As the clock tick input, I select TICK_ALWAYS (0xF)

As the test input, I select the 32 kHz crystal clock (0xB)

root@imx28evk:~# devmem2 0x800680e0 w 0x000b02cf

However, the DUTY_VALID does not go high as I would expect (i.e. the test signal is an approx. 50/50 duty cycle signal).

IRQ goes high, and LOW_RUNNING_COUNT gets a value, but HIGH_RUNNING_COUNT does not.

Read at address  0x800680E0: 0x000B82CF

Read at address  0x800680F0: 0xF1F83AD9

Read at address  0x80068100: 0x00000000

- It is not documented how UPDATE and RELOAD bits must be set in duty cycle mode.

- It is not documented how IRQ is handled in duty cycle mode

- Must I preload the FIXED_COUNT register to 0xffffffff?

Thanks for any insights to get this working,

Leon.

Labels (1)
0 Kudos
2 Replies

44 Views
alejandrolozan1
NXP Employee
NXP Employee

Please refer to the attached files. The code is using the TIMROT module but as an encoder.

I hope it helps.

Alejandro

0 Kudos

44 Views
jamesbone
NXP TechSupport
NXP TechSupport

alejandrolozano

Can you please share your example ?

0 Kudos