Hello again How stupid can one be? I have just seen the light (Haleluja). This thingie will never work, if i have to use two of the timers at one time. As i am clearing timr1, timr2 will never get incremented..... I saw this when i was laying in my bed this morning, and was just about to get out of it.... Funny places where the light shows up.. hehe... anyway, thanks to everyone that has (or is) using theire time on this subject... Also thanks to all the people that helped out on my last question.... - Thomas ---------- > Fra: Thomas Mxrch > Til: piclist@mitvma.mit.edu > Emne: problems, once again.. > Dato: 21. november 1997 01:34 > > Hi... > > Once again, i have banged my head in to a wall, and can't seem to find any > explanation to this thing (i'm using 16c84). > > I'm using an rtc interrupt, of aprox 12.8khz, and within this interrupt i > have three timers, that get's incrementet like this: > > incfsz timr1 ; 12.8khz incrementation. > goto exitint ; > incfsz timr2 ; Increment this timer 50 times a second > goto exitint ; > incf timr3 ; Increment timr3 each 5 seconds > > This part is working just fine (i believe).... But now the tricky part > comes: > > I then have a routine to make sound by toggle'ing an output pin, as this: > > streg clrf timr2 > stregLoop clrf timr1 ; 12.8khz timer > stregDel movlw tone ; > xorwf timr1,w > skpz > goto stregDel > call toggleBeep > movlw streglength > xorwf timr2,w > skpz > goto stregLoop > return > > toggleBeep movlw beeper > xorwf shadowb,f > goto updateport > > UpdatePort > movfw shadowb > movwf portb > return > > The problem is, that the streg routine doesn't exit. It just continues to > beep. I have set the streglength to 15 (ie about 0.3 seconds). > > I just can't see what's wrong with this thing... Anyone that has a clue? > > - Thomas.... >