[uCsimm] For exact date

From: 권석근 (kwonsk@mutech.co.kr)
Date: Thu Mar 09 2000 - 01:23:42 EST


Hi, all
somebody complained about inexact date (little slow or fast) of EZ328.
i tried to correct this and found that we could get exact time
with some modification.
instead of using default PLL divisor 506, i've set 500 (move 0x0922 to
PLLFSR
at ucsimm-head.S. sacrificed perfomance. 16.58MHz -> 16.38MHz).
and changed timer setting (in config.c) like this
TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_SYSCLK_16 | TCTL_TEN;
TPRER = (256-1);
TCMP = (40-1);
this mightl generate exact 100 Hz timer interrupt.
i've check this with "date" in an hour. and it showed exact time.

if you like over clocking :-) to 17.20MHz with also exact time
then use PLL divisor 525. (move 0x0624 to PLLFSR)
and timer setting
TCTL = TCTL_OM | TCTL_IRQEN | TCTL_CLKSOURCE_SYSCLK_16 | TCTL_TEN;
TPRER = (256-1);
TCMP = (42-1);
this will also keep exact time but overclocking must be bad for controller
:-)

Two values are works well and does not need UART divisor change upto 115200.
(near 1% clock differrence).

BTW, it's strange to me why TCMP need (WANTED value - 1).
EZ328 manual says that prescaler (TPRER) needs this adjustment but no
comment
on TCMP. i found this by experiment. maybe i didnot checked Errata.
well... does anybody has another idea? or already solved this
problem with another approach?
(If i'm right, this must be applied to RT-uClinux also for exact timing).

Thansk.
kwonsk.

This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:34 EST