Hi all
I am currently doing a project which requires the timing of signals via a PIC.
i am using the timer counter to count the time it takes between one input going high (input switch) and another input going high (external sensor). I am using the PIC16F84 and pin RBO to configure the external interupt. The external sensor is connected to RBO.
The problem lies with the PIC while it is waiting for the external interupt. If i put the pic in a loop until it recieves the external interupt, when i come out of the interupt it goes back into the loop. This is no good if i want to do something with the time/count after the interupt. It means all the stuff i want to do after the interupt i have to include inside the interupt.
Is there a way around this???? I was thinking about the sleep function instead of a loop but that would stop the clock which is needed for the PIC to continue counting.
Any ideas?
Cheers
Andy
I am currently doing a project which requires the timing of signals via a PIC.
i am using the timer counter to count the time it takes between one input going high (input switch) and another input going high (external sensor). I am using the PIC16F84 and pin RBO to configure the external interupt. The external sensor is connected to RBO.
The problem lies with the PIC while it is waiting for the external interupt. If i put the pic in a loop until it recieves the external interupt, when i come out of the interupt it goes back into the loop. This is no good if i want to do something with the time/count after the interupt. It means all the stuff i want to do after the interupt i have to include inside the interupt.
Is there a way around this???? I was thinking about the sleep function instead of a loop but that would stop the clock which is needed for the PIC to continue counting.
Any ideas?
Cheers
Andy