I can't get them to work. This is the first time working with them (previously I only targeted 83+BE) so I'm probably doing thing wrong.
To my understanding, this code should turn on timer 3, and set it to loop and trigger an interrupt, and count with a frequency of CPU/32.

Code:
   ld a,3
   out ($36),a
   ld a,$90
   out ($37),a
   ld a,3
   out ($38),a

But nothing happens. (running on wabbitemu)
What am I doing wrong?
First of all, to my knowledge WabbitEmu doesn't perfectly emulate the crystal timers, sicne they're mostly used for Direct USB and other such fun things. For starters, I don't see anything about '3' being a valid divisor for port $36 as per the WikiTI table on Port $30. It looks like only bits 0 and 1 of Port $37 are valid, so I think you meant to reverse your Port $36 and Port $37 initialization values. And for your port $38 value, you want to count down from 3?
Oops, got them reversed..
Don't know how I kept missing that, thanks

Yes I want to count down from 3, it's not a whole lot, I know - it should give a 96 cycle delay, which together with some other code adds up to the 160 cycle delay for the LCD. The idea behind it all is being able to do something while the LCD is being refreshed, where that "something" can be anything instead of just something that can manually be interleaved with the LCD refresh.
That makes sense, although I'm worried that you'll lose a significant fraction of the gain from having to set up the ports. Did you test out the fix values based on my feedback?
Yes, it's still not working, I'm going to look it over first though
harold wrote:
Yes, it's still not working, I'm going to look it over first though
Can I assume that the reason you're not giving it a try on real hardware to verify that you're not just running into a shortcoming of WabbitEmu is that you don't have a TI-84+ or TI-84+SE calculator?
I have a TI-84+black, but I don't want to brick it so I thought I'd ask first
harold wrote:
I have a TI-84+black, but I don't want to brick it so I thought I'd ask first
You'd have to work very hard to brick it just messing around with crystal timers. Smile I wouldn't worry too much about the potential for bricking until you start unlocking flash and trying to overwrite the certificate page.
I just confirmed that wabbitemu does indeed emulate all three crystal timers, so no need for real hardware here.. I guess I just did something wrong in the other code
[quote="harold"]I just confirmed that wabbitemu does indeed emulate all three crystal timers, so no need for real hardware here.. I guess I just did something wrong in the other code[/quofte] Hmm, what program did you use to verify that? Best of luck tracking down what the problem is; perhaps that other program you tried has source you can look at?
I wrote it myself, so I have the source Smile
harold wrote:
I wrote it myself, so I have the source Smile
Haha, fair enough. Smile It sounds like your current experiences with timers are that they are working only sometimes?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement