Bjarne Jensen

mcf54418: one millisecond resolution

Discussion created by Bjarne Jensen on May 12, 2011
Latest reply on May 13, 2011 by TomE

I am in the need for a timer with a one millisecond resolution to measure times between two characters as close to the uart as possible. I thought do_gettimeofday would do the job, but the times I get is going back and then jumps forward, then backward again. A snippet of the message log. Attached the mcf_tx_chars function.

 

drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000983548 us, ch: c
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000991642 us, ch: d
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000989738 us, ch: e
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000987832 us, ch: f
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000985926 us, ch: g
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000984020 us, ch: h
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000992116 us, ch: i
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000990210 us, ch: j
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000988305 us, ch: k
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000986400 us, ch: l
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000984494 us, ch: m
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000982589 us, ch: n
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177497 s 0000990684 us, ch: o
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000006906 us, ch: +
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000005030 us, ch: a
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000003122 us, ch: b
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000011215 us, ch: c
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000009309 us, ch: d
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000007404 us, ch: e
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000005498 us, ch: f
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000003594 us, ch: g
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000011688 us, ch: h
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000009782 us, ch: i
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000007877 us, ch: j
drivers/serial/mcf.c line 491 - mcf_tx_chars, time: 0188177498 s 0000005972 us, ch: k


Can anyone figure why?

 

Thanks,

Bjarne

Outcomes