Correction to "PIT initializing in MPC860"

Leon Pollak leonp at plris.com
Sun Jan 25 09:21:23 UTC 2004


Hello.
	First of all - a lot of thanks for the discussion.
	Next, as always, I missed the most important point that is the main obstacle 
for me and was the cause of the question:
	The file I mentioned in my first mail resides in 
../libcpu/powerpc/mpc8xx/clock/clock.c
	which seems to be not BSP specific file. And this was the cause of my 
question: as the PIT value is calculated in this "common" place, it must be 
general. Therefore, I though that I do not understand something.
	Now, from the discussion (and my own thoughts) I see two ways to solve the 
issue:

1. Try to adapt the code in place.

	Till now, the expression to calculate  the PIT value, which worked for me 
correctly in several projects was:

    PIT_Value = (CfgTableRTEMS.microseconds_per_tick / PLL_FACTOR *
                CfgTableCPU.clicks_per_usec) / 4 - 1 ;

Thus, in my case, microseconds_per_tick = 10000, clicks_per_usec = 25, 
PLL_FACTOR = 5.

The PLL_FACTOR value may be read from the PLPRCR register.

2. Simply define some configuration constant, let's say PIT_VALUE and assign 
it to this register.


I personally prefer the second solution, but what do the people think?

Thanks.
-- 
Leon M.Pollak
leonp at plris dot com




More information about the users mailing list