First post, by riplin
- Rank
- Newbie
Hi folks,
I'm doing some GUS programming and I'm having trouble getting the on board timers to function. I've confirmed that my interrupt handler is hooked up properly by hooking it up to int 8 instead and then it functions correctly. But when I try to hook it up to the IRQ of the GUS, and start the timers, nothing happens. This is what I'm doing:
My card reset function sets the global interrupt enable flag in the reset register (along with the two other bits):
- Write 0x4c (reset) to index register at port BaseAddress + 0x103 (0x3X3)
- Write 0x07 (master enable, dma enable, interrupt enable) to data high register at port BaseAddress + 0x105 (0x3x5)
Then when I configure the timer, I do the following:
Set up the timer start count:
- Write 0x46(timer 1 count) to index register at port BaseAddress + 0x103 (0x3X3)
- Write 0x05 (comes to 50Hz) to data high register at port BaseAddress + 0x105 (0x3x5)
Enable timer in timer control register:
- Write 0x45(timer control) to index register at port BaseAddress + 0x103(0x3x3)
- Write 0x04 (enable timer 1) to data high register at port BaseAddress + 0x105(0x3x5)
Start timer:
- Write 0x04 (Select timer control) to port BaseAddress + 0x008 (0x2x8)
- Write 0x01 (Start timer 1) to port BaseAddress + 0x009 (0x2x9)
From what I understand, this should kick off the timer, but nothing happens. I'm testing in DosBox-X and on real hardware using a PicoGUS. Both behave the same way thankfully (not working though). So it's obviously my fault, but I can't figure out why it won't work.
I've also confirmed that I'm actually talking to the card by detecting that the GUS is present (writing to GUS memory and checking the values).
What am I missing?
Any help is greatly appreciated!