Setup a free -running counter using processor expert

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setup a free -running counter using processor expert

Jump to solution
903 Views
juliancox
Contributor V

I am using a timer FC1 with device TMP10 to generate a 2mS interrupt and it works fine. I now need to use a second counter (maybe FC2) to measure the time it takes for an external input to trigger the on-chip comparator. In the Comparator ISR I need to stop the timer and read the timer value (16-bit). In real time the comparator should trigger anywhere from a few 10s of uS to a few hundreds of uS. However, Component Inspector asks for a period/offset value, which I don't think I need. which timer and clock source should I use? 

Tags (2)
0 Kudos
1 Solution
626 Views
BlackNight
NXP Employee
NXP Employee

Hi Julian,

then there are the FreeCntr8, 16 and 32bit components you can use:

pastedImage_1.png

Erich

View solution in original post

0 Kudos
5 Replies
626 Views
juliancox
Contributor V

Perhaps I should simplify my question. I need to start a 16-bit timer clocked at about ~4...5Mhz, stop it and read the time - thats basically it - no interrupts, no compare, nothing else - just start, count, stop, read.

0 Kudos
626 Views
BlackNight
NXP Employee
NXP Employee

Hi Julian,

use the TimerUnit_LDD:

pastedImage_1.png

Enable/Disable starts/stops the counter. ResetCounter is used to set it back to zero, and with GetCounterValue you get the counter register value.

pastedImage_2.png

Set your timer frequency with interrupts disabled.

Voilà :-).

I hope this helps,

Erich

0 Kudos
626 Views
juliancox
Contributor V

Hi Erich,

Thanks for your reply, but this looks like deja vu. Your reply looks very much like a solution for an ARM device. However, I omitted to specify (again) that I am using a S08QE and a S08SH processor. Sorry to have wasted your time.

0 Kudos
627 Views
BlackNight
NXP Employee
NXP Employee

Hi Julian,

then there are the FreeCntr8, 16 and 32bit components you can use:

pastedImage_1.png

Erich

0 Kudos
626 Views
juliancox
Contributor V

Thank you for your help. I looked at a that before but there was no "GetTicks" option. I eventually found it when I clicked on the "Advanced" option in the Component Inspector window.

0 Kudos