i have a problem with the PIT not triggering an IRQ. I have all things set up (i hope correctly), but the interupt is simply not triggered. interupts work well alltogether, triggering the correspoding int manually using inline assembly works perfectly.
Also i have checked my PIT setup, but reading the timer count in a tight loop, giving me different values all the time, so it ticks...
IRQ0 is unmasked on the master PIC, so that shouldn't be a problem either.
is there a simple way to check wether any of the PIC triggered interupts are delivered?
my PIC setup is done like this:
Code: Select all
master_mask = _inp(SX_PIC_MASTER_DAT);
slave_mask = _inp(SX_PIC_SLAVE_DAT);
/* begin init, include ICW4 */
_outp(SX_PIC_MASTER_CMD, SX_PIC_ICW1_INIT | SX_PIC_ICW1_IC4);
_outp(SX_PIC_SLAVE_CMD, SX_PIC_ICW1_INIT | SX_PIC_ICW1_IC4);
/* set the interupt vector offsets */
_outp(SX_PIC_MASTER_DAT, SX_IRQ_BEGIN);
_outp(SX_PIC_SLAVE_DAT, SX_IRQ_BEGIN + 8);
/* now send the IRQ lines to connect the two PICs */
_outp(SX_PIC_MASTER_DAT, 4);
_outp(SX_PIC_SLAVE_DAT, 2);
/* now ICW4 */
_outp(SX_PIC_MASTER_DAT, SX_PIC_ICW4_8086);
_outp(SX_PIC_SLAVE_DAT, SX_PIC_ICW4_8086);
SxConPrint(" * IRQ's remapped to higher Interupts ...\n");
SxConPrint(" * Interupt Mask on PICs: Master: %bb Slave: %bb\n", master_mask, slave_mask);
_outp(SX_PIC_MASTER_DAT, master_mask);
_outp(SX_PIC_SLAVE_DAT, slave_mask);
Code: Select all
void SxTimerInit(sx_uint32 interval) {
sx_uint32 divisor = SX_PIT_FREQUENCY / interval;
sx_PitCommand cmd;
SxIrqHandlerSet(0, SxHandleTimerIRQ);
cmd.cmd.bcd = 0;
cmd.cmd.mode = SX_PIT_MODE_RATE;
_outp(SX_PIT_PORT_CMD, cmd.raw);
_outp(SX_PIT_PORT_CH0, divisor & 0xFF);
_outp(SX_PIT_PORT_CH0, (divisor>>8) & 0xFF);
SxConPrint(" * Timer divisor set to %d\n", divisor);
SxUnmaskPICInterupt(0);
}