Code:
	Runtimer:
TMR0ON = 1
TMR0IF = 0
IF TMR0IF = 1 THEN HIGH PORTB.4
GOTO Main
 Your polling technique has holes.  When you enter Runtimer, you clear the flag and turn the timer on.  If it has not overflowed, you go to main and spend a lot of time talking to your LCD ... then you turn the timer off.  If the TMR0 overflows while in the LCD routine (odds are that this is where it will overflow), you clear the flag right before polling.  Change to something like this:
	Code:
	Runtimer:
TMR0ON = 1
IF TMR0IF = 1 THEN 
	HIGH PORTB.4
	TMR0IF=0		' clear flag after you have trapped it
ENDIF
GOTO Main
 
				
			 
			
		 
			
			
			
				
					Last edited by paul borgmeier; - 17th June 2008 at 08:49.
				
				
					Reason: EDIT: also add comments - makes your code easier to read
				
			
			
			
                        	
		         
			
			Paul Borgmeier
Salt Lake City, UT
USA
__________________
			
			
		 
	
Bookmarks