Calculator Community > ASM

Interrupt question

(1/2) > >>

E37:
Quick question: Is there anyway to set an interrupt to trigger in X clock ticks? I was looking at some code and think I found a way to shave ~600-1800 clock ticks off of fastCopy (the lcd routine) if there is.

Geekboy1011:
Depends on the model! On the models with crystal timers yes, On the models with out sadly no.

E37:

--- Quote from: Geekboy1011 on April 05, 2018, 05:38:48 pm ---Depends on the model! On the models with crystal timers yes, On the models with out sadly no.

--- End quote ---
My knowledge is somewhat... lacking... in crystal timers. Can it be accomplished in > ~20 clock cycles?
In generalized pseudocode is to:

--- Code: ---Interrupt:
exx
64 loop for y
ld i,(breakSave) // change the interrupt location (I know you can't just set I)
12 loop for x
set interrupt to trigger in ~25 clock ticks (15 for next 2 instructions and 10 for after)
exx
ret
//go and execute 1 or 2 instructions while we wait for the lcd to be ready
breakSave: //when the interrupt triggers it will jump to right here
exx
out ($10),a // write to the lcd
endXLoop:
endyLoop:
ld i,(Interrupt) // restore the interrupt location
exx
ret

--- End code ---
I'm not sure if all the code is correctly formatted. Ignore any incorrect syntax. I'm sure you get the idea of what my goal is. I want to spend time executing useful code while I wait for the lcd to be ready for another write. It only works if the function is in an interrupt of course. I don't think that it will help with greyscale display since they have less waisted time waiting for the lcd to be ready. I can't create the method since I don't know how to use crystal timers. Some code showing me how to use them would be nice.

Xeda112358:
I don't know crystals timers well, sorry. I do however remember a comment from about six years ago by thepenguin77, I think, involving this same premise. I couldn't find the post though :(

Hooloovoo:
I believe there is a way to set an interrupt on a certain number of cpu cycles having elapsed. I haven't ever used it, though.
http://wikiti.brandonw.net/index.php?title=83Plus:Ports:30
From what I understand about the timers, you could set the counter to 15, and the on/off port to 0x80 to get interrupts every 15 ticks.

Navigation

[0] Message Index

[#] Next page

Go to full version