RTI, TOI and TOC programming

infinitig35's Avatar, Join Date: Oct 2008
Newbie Member
Hello everyone. I have a homework problem that I'm stuck at, can someone give me a hint on how to proceed with this. Here's the problem:
Write a program that uses both an RTI (Real Time Interrupt) and an TOI (Timer Overflow Interrupt) or a TOC (Timer Output Square). Have each of the interrupts do something different.

thanks
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
This will depend very much on what the last few weeks' course content. These questions are not generic; they are very specific, so any answers will be completely useless unless we just happen to guess precisely what kind of hardware you're using.

Do you understand the question? Whatever hardware you're using that will be the first step. If you don't, then either there's been no info on it in the course so far, in which case why is the teacher asking you, or you haven't been paying attention.
0
infinitig35's Avatar, Join Date: Oct 2008
Newbie Member
I'm using the Motorolla M68HC11.
0
infinitig35's Avatar, Join Date: Oct 2008
Newbie Member
Where are the experts at??
0
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
Where they always were. We don't have details on your hardware (which is more than just the chip - what is the development kit you're using?) so there's nowt we can do, unless one of us by pure chance just happens to have exactly the same as wot you've got on your desk.

Where exactly are you stuck? Do you understand the assignment? Di you understand the concepts (which should have been explained in the course)? Have you designed the program yet? Have you started coding and hit a problem? Are the interrupts being generated correctly? How exactly are they being generated; what external hardware causes an interrupt?

Generally interrupt processing goes along the lines of "ok, we got an interrupt, so disable interrupts to stop us disappearing up our own backside, and look to see what interrupted us. Then set a flag for the main program to pick up on the fact that an interrupt happened, re-enable interrupts and exit as quickly as possible."
The main program needs to setup the interrupts of course, by setting the appropriate interrupt registers, and by checking periodically for whether or not any interrupt has occurred. If you know for certain that interrupts aren't that frequent, you MAY be able to do some limited processing within the interrupt routine, but generally you need to exit as quickly as possible because normally you don't know when the next interrupt will be.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by xpi0t0s View Post
Where they always were.
Well said.