HPET can only produce 100 interrupts per second?
Posted: Sun Nov 24, 2013 12:47 am
Now I'm trying to use HPET instead of PIT.
But I have a problem:I'm using QEMU.I try to configure HPET and let it produce 1000 interrupt per second.
First,I get the period of HPET.
Next,I clear the counter of HPET and enable it.
Then I wait a minute and check if the counter is counting.The result is true.
Finally,I start the interrupt of HPET and set the configure of the timer0.
And set the compare register of timer0:
I want to change "time" to change how many interrupts HPET produce per second.
If I set "time" to a big number,it will be successful!
But when I set "time" to a small number even 1,I failed!It can only produce about 100 interrupts per second.
I want HPET to produce about 1000 interrupts per second,how should I do?
(I also try to use one shot mode and change the compare register when interrupts come,but I also failed.)
Thank you very mush!
But I have a problem:I'm using QEMU.I try to configure HPET and let it produce 1000 interrupt per second.
First,I get the period of HPET.
Next,I clear the counter of HPET and enable it.
Then I wait a minute and check if the counter is counting.The result is true.
Finally,I start the interrupt of HPET and set the configure of the timer0.
Code: Select all
/*Index = 0.*/
u32 conf = hpetIn(HPET_TIMER_CONF_REG(index));
conf |= HPET_TIMER_CONF_PERIODIC;
conf |= HPET_TIMER_CONF_ENABLE;
hpetOut(HPET_TIMER_CONF_REG(index),conf);
Code: Select all
hpetOut(HPET_TIMER_CMP_REG(index),time);
If I set "time" to a big number,it will be successful!
But when I set "time" to a small number even 1,I failed!It can only produce about 100 interrupts per second.
I want HPET to produce about 1000 interrupts per second,how should I do?
(I also try to use one shot mode and change the compare register when interrupts come,but I also failed.)
Thank you very mush!