Problema con retardo pic16f877a

Hola espero me puedan ayudar un poquito con esto de los retardos ya que no mas no puedo hacer funcionar el retardo que genere con el picdel se los agradeceria muchisimo.

Este es mi programa:

Código:
	LIST P=16F877A
	INCLUDE <P16F877A.INC>
             __CONFIG _WDT_OFF&_PWRTE_ON&_XT_OSC&_LVP_OFF&_CP_OFF

;************Programa principal****************;
RESETEO        ORG 0
	       GOTO INICIO
	       GOTO 5
;***************INICIO**********************;
INICIO                 BSF STATUS,RP0   ;USAMOS EL BANCO 1 DE LA MEMORIA
                       MOVLW b'00000001'
                       MOVWF TRISB      ;configuramos a rb0 entrada y rb1 como salida..
                       BCF STATUS,RP0  ; ACCEDE BANCO 0
					   BSF PORTB,1
					   CALL PDelay
					   BCF PORTB,1
GOTO INICIO

;-------------------------------------------------------------
; Code generated by PDEL  ver 1.0  on 14/10/2011 at 04:28:42 p.m.
; Description: Waits 1000000 cycles
;-------------------------------------------------------------
CBLOCK
PDel0
PDel1
PDel2
ENDC

PDelay  movlw     .14       ; 1 set number of repetitions (C)
        movwf     PDel0     ; 1 |
PLoop0  movlw     .72       ; 1 set number of repetitions (B)
        movwf     PDel1     ; 1 |
PLoop1  movlw     .247      ; 1 set number of repetitions (A)
        movwf     PDel2     ; 1 |
PLoop2  clrwdt              ; 1 clear watchdog
        decfsz    PDel2, 1  ; 1 + (1) is the time over? (A)
        goto      PLoop2    ; 2 no, loop
        decfsz    PDel1,  1 ; 1 + (1) is the time over? (B)
        goto      PLoop1    ; 2 no, loop
        decfsz    PDel0,  1 ; 1 + (1) is the time over? (C)
        goto      PLoop0    ; 2 no, loop
PDelL1  goto PDelL2         ; 2 cycles delay
PDelL2  clrwdt              ; 1 cycle delay
        return              ; 2+2 Done
;-------------------------------------------------------------

end

Lo he simulado en el proteus y pues nada mas no corre :LOL:.
Saludos y disculpen la molestia de mi ignorancia :LOL:.

Otra cosa, al simularlo en el proteus me sale el siguiente warning:

[PIC16CORE]PC=0x0008. Stack Overflow Executing CALL Instruction. Es esto normal?

A lo que quiero llegar es a hacer parpadear un led :LOL:.
 
Última edición:
Hola, "no, no es normal que salga el mensaje.... Stack Overflow Executing CALL Instruction".
y exixten pequeños erroes en el codigo que tienes, "pero nada que no se solucione".:D
 

Adjuntos

  • delay.rar
    24.3 KB · Visitas: 27
Atrás
Arriba