timer interrupts driving port pins low when inputs
Posted: Thu Jul 03, 2008 4:38 am
Hi
i have written a peice of code for PIC16F687 where i am running a timer0 is used as a refresh rate on a segment display.
on PORTA pin 5 i have a switch that uses the internal pull up resistor and is used active low.
for some reason the interrupt of the timer is driving the pin low on the interrupt.
i look at the datasheet and the interrupt of the time and the pin use the same 5th bit but should be in different registers and should not effect each other.
Does anyone have any ideas to what is going on, and is there a way i can just read the registers direct rather than passing a value in to a function.
i tried using a different timer in the PIC but none of them are fast enough to uses with the segment display.
Ttelmah Guest
Posted: Thu Jul 03, 2008 4:44 am
What compiler version?.
What are you actually doing in the interrupt?.
The timer0 interrupt, _does not use bit 5 of any register_. It uses bit 2. The only thing using bit 5, for this interrupt, is the 'enable', which once set by you during the startup, is not changed in any way at all by the interrupt.
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