PIT initializing in MPC860
Thomas Doerfler
Thomas.Doerfler at imd-systems.de
Thu Jan 22 20:35:56 UTC 2004
Hello Leon,
I also got stuck at these lines. These lines were initially
coded for a mpc860 system, where the PIT was fed by an
external 4 MHz crystal, not the 25MHz oscillator. For a 4MHz
crystal, you set
Cpu_table.clicks_per_usec=4
Cpu_table.microseconds_per_tick=10000
and get a resulting PIT initalization value of 40000, which is
just a bit below 2^16. This works fine.
If your PIT input clock gets increased (to 25MHz) then the
resulting divider value simply does not fit into the 16 PIT
reload register and then you get odd system tick frequencies.
You may activate the prescaler between the clock input and the
PIT input (divide by 128), but in that case you get very odd
timer tick frequencies.
We came over this some weeks ago on newer MBX860 boards, and
due to certain reasons I only could hack together a solution
for demo purposes, but I did not yet find time to implement it
cleanly. (Yes, Joel, I know you are waiting for it aswell...)
I hope this helps a bit.
wkr,
Thomas.
> Hello to MPC860 gurus :-)
>
> I am stuck with the following small issue:
> The file ../libcpu/powerpc/mpc8xx/clock/clock.c contains:
>
> pit_value = (rtems_configuration_get_microseconds_per_tick() *
> rtems_cpu_configuration_get_clicks_per_usec()) - 1 ;
>
> and this value is calculated incorrectly in my case - MPC860 running at 25MHz
> I put Cpu_table.microseconds_per_tick=10000 (10ms per RTEMS clock) and
> Cpu_table.clicks_per_usec=25.
>
> This means that I incorrectly understand the meaning of
> Cpu_table.clicks_per_usec. As it is also used in several other places, I do
> not want to change it by deriving the required value from the formula in
> MPC860 manual.
>
> I tried to find something in documentation, but was not able to find this
> Cpu_table, which is used in mpc8xx.
>
> I shall be very thankful for clarification.
> --
> Leon M.Pollak
> leonp at plris dot com
--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler Herbststrasse 8
D-82178 Puchheim Germany
email: Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm
More information about the users
mailing list