ac.tomo Posted June 22, 2021 Share Posted June 22, 2021 I have a bit of a dilemma. The program below sets and executes an IRQ Timer-1 interrupt but I'm baffled: The 'timer' interrupts are meant to be used when timing something quicker than jiffies (1/50thsec) right!? But that contradicts the fact that the timers are decremented every immediate V/Blank? 10 POKE 53768,0 - SET CLOCK FREQ. 20 FOR I=0 TO 9 - PUT M/C INTO P6 30 READ D:POKE 1536+I,D:NEXT I 40 DATA 173,10,210,41,248,141,24,208,104,64 50 POKE 528,0:POKE 529,6 - SET ADDRESS OF TIMER-1 60 POKE 53760,30 - RE-EXECUTE DELAY (CLK PULSES) 70 POKE 16,193:POKE 53774,193 - ENABLE INTERRUPT 80 POKE 53769,1 - RESET COUNTER Am I doing something wrong, I'm confused. Please, can someone clarify this situation. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted June 22, 2021 Share Posted June 22, 2021 You might be confusing software countdown timers (CDTMVx/CDTMAx) with pokey timer irqs (VTIMRx)? Quote Link to comment Share on other sites More sharing options...
ac.tomo Posted June 22, 2021 Author Share Posted June 22, 2021 (edited) 21 minutes ago, Wrathchild said: You might be confusing software countdown timers (CDTMVx/CDTMAx) with pokey timer irqs (VTIMRx)? Do you know, that is exactly what I was doing, thanks for that wrathchild. In all the years I've been programming I never realised that there were system software timers as well as the IRQ ones. That definately clears up that problem. NB* Does anyone know if my code is correct, because I expect system control to return to Basic alike NMI DLI's in between IRQ executions but it doesn't, is this correct? Edited June 22, 2021 by ac.tomo Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 22, 2021 Share Posted June 22, 2021 That code works. For Pokey Timers much more frequent than that (looks to be every 8th scanline) you'd probably want to do a custom VIMIRQ handler. The system IRQ handler puts the timers fairly low in the order of priority so there's a long code path before your code is run. When doing that you'd then have to do extra stuff like testing and resetting IRQ status and enable bits. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.