Hello!

I'm using a 12F629 for a simple project, and the code basically goes like this

#use internal oscillator

Main:
If Pin5 = ON then Goto SUB1
If Pin5= OFF then Goto SUB2

Sub1
Set Pin1 ON
Set Pin2 ON
Wait 10ms
Set Pin1 OFF
Set Pin2 OFF
Wait 2s
Set Pin 3 ON
Set Pin 3 OFF
Goto Main

Sub2
Set Pin4 ON
Set Pin4 OFF
Goto Main

Now this isn't the real code, only something I'm using as an example.

The problem I'm having is that the timing in Sub1 seems to be fine for the first few minutes, then changes drastically within about 15 minutes - it's not always timing 2s; sometimes it will be too slow, other times it will be too quick. My thought was that if I added a resonator, these problems would go away - since the internal osc is temperature sensitive. I would like to keep the chip small and not use an external osc as I am currently using all the pins on the micro. Adding an external osc would force me to free up 2 pins and to keep functionality I'd have to use a bigger chip.

I think the problem might still remain, even with an external oscillator, because of the nature of the code. Does having multiple things going on change the timing at all? I could split the code onto two different chips, but that's even worse than using a bigger chip! I'm really just looking for some Protips.

I'll try to post the actual code later today.

Thanks!