Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

32bits counter on PIC assembly ?

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
Activity points
9,442
Guys,

How can I reduce the 32bits counter on Microchip assembly ?

I've done 16 bits :

Code:
                 LedTimer    RES 2
; these lines will be done on 100ms Timer0 interrupt (btfss INTCON,T0IF)
	        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 

counter
 	decf    LedTimer,F         ; Decrement low byte
        incfsz  LedTimer,W         ; Check for underflow
        incf    LedTimer+1,F       ; Update
        decf    LedTimer+1,F       ; Fixup
        movf    LedTimer,W
        iorwf   LedTimer+1,W       ; Set Z bit
		return

Any clues ?
Have a nice weekend,
Thanks
 

Take a look at **broken link removed**, may be it´s what you need

Simao Berkof


Guys,

How can I reduce the 32bits counter on Microchip assembly ?

I've done 16 bits :

Code:
                 LedTimer    RES 2
; these lines will be done on 100ms Timer0 interrupt (btfss INTCON,T0IF)
	        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 

counter
 	decf    LedTimer,F         ; Decrement low byte
        incfsz  LedTimer,W         ; Check for underflow
        incf    LedTimer+1,F       ; Update
        decf    LedTimer+1,F       ; Fixup
        movf    LedTimer,W
        iorwf   LedTimer+1,W       ; Set Z bit
		return

Any clues ?
Have a nice weekend,
Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top