summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libcpu
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-05-07 16:28:43 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-05-07 16:28:43 +0000
commitb06279dfc01d46226c081570607096a8095ff00e (patch)
tree442127abe3b2f488df61ac72bf660b0a6771683b /c/src/lib/libcpu
parentAdded paragraph for Tony Ambardar (tonya@ece.ubc.ca) submitting (diff)
downloadrtems-b06279dfc01d46226c081570607096a8095ff00e.tar.bz2
Bug fix from Gunter Magin <magin@skil.camelot.de>:
in libcpu/powerpc/mpc860/clock/clock.c:InstallClock() the reload value for the PIT is defined as: pit_value = (BSP_Configuration.microseconds_per_tick * Cpu_table.clicks_per_usec) - 1 ; What exactly is a tick, and what is a click? My confusion stems from the fact, that Jay defines clicks_per_usec to 1 which is correct for his configuration, where a 4MHz clock is predivided by 4 and then fed to the PIT. So I assume a "click" is just the period of the PIT input frequency. However, our HW config seems to have 32.768 kHz crystal input for PIT. Mandatory division by 4 means 8.196kHz (122usec) at the PIT. I think, the above assignment should read: pit_value = (BSP_Configuration.microseconds_per_tick / Cpu_table.clicks_per_usec) - 1; where I can define Cpu_table.clicks_per_usec in bspstart.c to 122 (clicks_per_usec). That would lead to a PIT reload value of 10000/122 - 1 = 81 to reach a 10ms "tick" period.
Diffstat (limited to 'c/src/lib/libcpu')
-rw-r--r--c/src/lib/libcpu/powerpc/mpc860/clock/clock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/c/src/lib/libcpu/powerpc/mpc860/clock/clock.c b/c/src/lib/libcpu/powerpc/mpc860/clock/clock.c
index 928c9e5a96..d63cd5a5cf 100644
--- a/c/src/lib/libcpu/powerpc/mpc860/clock/clock.c
+++ b/c/src/lib/libcpu/powerpc/mpc860/clock/clock.c
@@ -74,7 +74,7 @@ void Install_clock(rtems_isr_entry clock_isr)
Clock_driver_ticks = 0;
- pit_value = BSP_Configuration.microseconds_per_tick *
+ pit_value = BSP_Configuration.microseconds_per_tick /
Cpu_table.clicks_per_usec;
if (pit_value == 0) {
pit_value = 0xffff;