+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Member level 3
    Points: 1,223, Level: 7

    Join Date
    May 2012
    Location
    WEST BENGAL,INDIA
    Posts
    55
    Helped
    0 / 0
    Points
    1,223
    Level
    7

    need assembly code for 7 sec delay using pic16f886 by timer0

    hi everybody!!
    I need a asm code for my project,7 sec delay using pic16f886 timer0.my OSC fq. is 4MHz,prescaler is 1:256.I want to blink 2 led from portB.each blink continuously after 7sec.
    please please please, help me anybody.
    thanks!!!

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 1
    Points: 1,014, Level: 7
    Achievements:
    7 years registered
    hexreader's Avatar
    Join Date
    Apr 2011
    Location
    England
    Posts
    490
    Helped
    193 / 193
    Points
    1,014
    Level
    7

    Re: need assembly code for 7 sec delay using pic16f886 by timer0

    The gooligum tutorials are fantastic. They will have you writing programs in no time.

    You can find them here: http://www.gooligum.com.au/tutorials.html


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Member level 3
    Points: 1,223, Level: 7

    Join Date
    May 2012
    Location
    WEST BENGAL,INDIA
    Posts
    55
    Helped
    0 / 0
    Points
    1,223
    Level
    7

    Re: need assembly code for 7 sec delay using pic16f886 by timer0

    thank you hexreader..................



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 3
    Points: 4,522, Level: 15

    Join Date
    Jun 2010
    Posts
    724
    Helped
    223 / 223
    Points
    4,522
    Level
    15

    Re: need assembly code for 7 sec delay using pic16f886 by timer0

    Or, from PicList:

    Code:
    ; Delay = 7 seconds
    ; Clock frequency = 4 MHz
    
    ; Actual delay = 7 seconds = 7000000 cycles
    ; Error = 0 %
    
    	cblock
    	d1
    	d2
    	d3
    	endc
    
    			;6999998 cycles
    	movlw	0x3F
    	movwf	d1
    	movlw	0x43
    	movwf	d2
    	movlw	0x10
    	movwf	d3
    Delay_0
    	decfsz	d1, f
    	goto	$+2
    	decfsz	d2, f
    	goto	$+2
    	decfsz	d3, f
    	goto	Delay_0
    
    			;2 cycles
    	goto	$+1
    Source: http://www.piclist.com/cgi-bin/delay...=Delay&CPU=PIC

    John



--[[ ]]--