PDA

View Full Version : IOC question



Adrian
- 1st April 2008, 15:53
I would like to be clear about IOC routines and would be grateful for confirmation or correction of my understanding. AN566 helps but leaves me with a question...

Firstly for a pulse that is longer than the interrupt routine……
A. The port should be read to a variable to end the mismatch condition
B. The flag is cleared
C. The interrupt routine is completed.

In this case if an interrupt is called by a rising pulse, it will also be called again later when the pulse returns to zero.

If the interrupt routine is lengthy and the pulse is shorter than the routine then that routine will presumably end with another mismatch. In this case I guess the port should be read again to the (port) variable at the end of the routine?

Should the flag again be cleared? If so can the flag just be cleared once in the routine, at the end?

Thank you for yr help


Adrian

mister_e
- 1st April 2008, 16:24
Can you describe your whole project?

Adrian
- 1st April 2008, 16:55
Thanks, but there's no project yet.I'm trying to understand IOCs as a theoretical exercise rather than a problem that has come up in a project. I can guess it will rear its head soon though and I want to understand what I'm doing!!

Adrian

Adrian
- 1st April 2008, 17:58
I've sorted it now, Steve.. many thanks

mister_e
- 1st April 2008, 19:21
Thanks for sharing your code ;)