timer timer timer, why can't i get you right?
May 14, 2010
So i set up the forum topic on pwm only to realise that i skipped the setting up of the timer! This is such a pain. So here is some code that i wrote to get the timer0 working. Please tell me what i need to add and what is wrong. I'm really frustrated with this part of PIC, very confusing. I think this is a much more apt question to begin with.
Here's the code:
;1 SECOND DELAY
DELAY1 "IM SUPPOSED TO SET PRESCALER TO 32 BUT I DONT KNOW HOW TO"
CLRF TMR0; this should start the timer accodring to a book i got. but i get an error saying that it is not defined
LOOPA MOVF TMR0,W; basically movign tmr0 val in w, again tmr0 is not defined
SUBLW .15625; -15625 from tmr0 with prescaler 32
ZEROBIT; this is supposed to check if the result is 0 but zerobit is not defined.
GOTO LOOPA; if result is still not 0
RETLW 0; if result is 0 go back to program where this loop was called(e.g. main)