How can I reduce 16 counter on PIC assembler ?

Status
Not open for further replies.

bianchi77

Advanced Member level 4
Joined
Jun 11, 2009
Messages
1,313
Helped
21
Reputation
44
Reaction score
20
Trophy points
1,318
Location
California
Visit site
Activity points
9,442
Guys,

How can I reduce 16 counter on PIC assembler ?

I've done this code but only reducing the low part of the counter, it didn't reduce the high part, how can I reduce all of them ?
What do I miss here ? any helps will be appreciated, thanks
Code:
                        movf 	    LedTimer,w		;for every 10 counts
    	 		btfss 	    STATUS,Z		;check the counter if it's already zero
			return						;return to main loop
	            
                 
                movf         LedTimer+1,w        ;for every 10 counts
                btfss         STATUS,Z        ;check the counter if it's already zero
                return            
				
				bcf		PORTB, POWERLED 	;Turn off LED
				
				movlw LOW .300
				movwf LedTimer
				movlw HIGH .300
				movwf LedTimer+1 

counter
   Global 	counter	
         BANKSEL 	LedTimer		;timer value
    	 movf 	    LedTimer,w		;for every counts
    	 btfss 	    STATUS,Z
         decf   	LedTimer,f
		 return

 		 BANKSEL 	LedTimer+1	
     	 movf 	    LedTimer+1,w		;for every counts
    	 btfss 	    STATUS,Z
         decf   	LedTimer+1,f  
         return
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…