Hello people,
I'm wondering if someone can help me with internal interrupts. I'm using the PIC18f452 ADC to get a reading from a wall sensor (its an IR transmit receive circuit) which gives out numbers ranging from 0 to 500 (these numbers correspond to how far the sensor is from the wall). What I'm trying to do is generate an interrupt when the number is 250. I've thought about connecting a pin to the external interrupt pin on PORTB, but I'm already using them for another function and I have limited I/O pins available. What I'm thinking is along the lines of a software interrupt generated say in similar fashion to that of timer interrupts. I'm wondering if its possible to make timer0 (for example) over flow (FFh to 00h) when ADC returns 250. I'm not sure if what I'm thinking of is at all possible, and I am open to any ideas.
I hope there is somebody who can help me, thanks a lot.
Dimithri