[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] 10 msec number of ticks bug..
DeviPrasad Natesan wrote:
> I had 10msec accuracy problem in my system (ntpd had many drift). Then
> i could figure out 300 ticks drift happening every second becos of the
> wrong initial value in the timer register i belive. We verified my
> change with the free running counter implemented in the fpga and
> comparing the value every one second and we could see a drift of
> around 6 ucsec.
> The change is in the microblaze_timer.c
> count = ((unsigned)-1) - CONFIG_XILINX_CPU_CLOCK_FREQ / rate - 2;
> count = -(CONFIG_XILINX_CPU_CLOCK_FREQ / rate) + 1;
> One extra tick is required (might be bcos of an extra tick happening
> while loading the value back to the comparator register.
Interesting - it's a long time since I looked at that code, but from memory I
did the timer counter load value based on the formula in the opb_timer
datasheet. As you say, perhaps it's necessary to compensate for the time it
takes to actually reset the counter?
> Please confirm this and if it is right apply the change.
You say you tested with with ntpd / ntpclient? Can you please post a few
details about your test, and I'll try to replicate it here.
Thanks for your efforts,
microblaze-uclinux mailing list
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/