Skip to contentSkip to conversation

ppc-4xx timer application problem

U-Boot prathika 1 participant 1 message Jul 1, 2009

lore
Share & tools
lore

prathika

author
#0 lore raw

hi all,
I am working on PPC440EP based board.I have ported u-boot on the board. I was able to fix the problem of extracting data from the flash and executing it.
Now I want to run a timer based application on u-boot. I am expecting periodical interrupts based on my configured value.
I have written a timer application but there is no interrupts with respect to my configuration.
--I have configured GPT0_COMP6 with 0x120 and CPT0_MASK6 registers with value 0x0.
--I disabled the Interrupt mask bit in GPT0_IM register for Compare Timer6. --I have enabled interrupt in GPT0_IE register for Compare Timer6. --I am installing interrupt handler for Compare Timer6 using install_hdlr() function.

When I run this application, the behaviour is like this:
Interrupts are generated when the GPT0_TBC overflows to a certain value that is not equal to my GPT0_COMP6 value. That is the TBC counts continously,
overflows from 0xFFFFFFFF to 0x0 and then there is a interrupt when TBC value is 0x22b. And still the TBC continues to count even though I am writing 0x0 in my interrupt handler, overflows and when again it reaches 0x22b, there is a interrupt generated, and this 0x22b value is not fixed, sometimes its 0x22b and sometimes its 0x220.

Some one please help me in this regard and point out where am I going wrong? Is the behaviour I am expecting from the timer right and the timer misbehaving? Or have I not understood it's behaviour properly?

Thanks & Regards,
Prathika R