gladtor_455
Newbie level 5
![Newbie level 5](/styles/images/ranks/blevel2.gif)
hi every one
i am working on a project and i have a proplem i need aa program to send any number as serial from PORTA,0 and between every digit 10 us delay
and the time for every digit is 50 us for example
the number b'11111111' send one in porta,0 for 50 us then clear PORTA,0 for 10 us then continue send the rest with the same system
i wrote a programe but after the 8 digits there is a period about 80 us that PORTA,0 is off then it continue
and for the simulation programe there is message that stack overflow executing call instructionthis is the pograme
if there is anyone can tell me where is the problem and how tocorrect it
; Processor Type PIC16F877A .
LIST P=16F84A
;********************************************************************************************************$
; Include An Additional File In The Program .
#INCLUDE "P16F84A.INC"
;********************************************************************************************************$
; Configuration Register Bits .
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
;********************************************************************************************************$
; Reset Vector .
org 0x00 ; Processor Reset Vector .
CBLOCK 0X20 ; here block variables
counter
cood_0
d1
ENDC ; blocking ends
GOTO Start ; Go To Beginning Of Program .
;********************************************************************************************************$
; Interrupt Vector .
org 0x04 ; Processor Interrupt Vector .
retfie
;********************************************************************************************************$
;********************************************************************************************************$
; Start of Program .
Start
banksel TRISB
movlw b'11111111'
movwf TRISB
banksel TRISA
clrf TRISA
banksel PORTA
clrf PORTA
movlw b'11111111'
movwf cood_0
PORTB_CHECK
movlw .4
movwf counter
banksel PORTB
btfsc PORTB,0
call function_0
goto PORTB_CHECK
function_0
btfss cood_0,0
call send_zero
call send_one
send_zero
banksel PORTA
BCF PORTA,0
call delay_50
rrf cood_0,f
decfsz counter,f
goto function_0
clrf PORTA
bcf STATUS,0
goto PORTB_CHECK
send_one
banksel PORTA
BSF PORTA,0
rrf cood_0,f
call delay_50
bcf PORTA,0
call delay_10
decfsz counter, 1
goto function_0
clrf PORTA
goto PORTB_CHECK
delay_50
movlw 0x0d
movwf d1
Delay_3
decfsz d1, f
goto Delay_3
return
delay_10
goto $+1
goto $+1
goto $+1
goto $+1
return
LOOP GOTO LOOP
;********************************************************************************************************$
END ; Directive 'end of program'.
**broken link removed**
i am working on a project and i have a proplem i need aa program to send any number as serial from PORTA,0 and between every digit 10 us delay
and the time for every digit is 50 us for example
the number b'11111111' send one in porta,0 for 50 us then clear PORTA,0 for 10 us then continue send the rest with the same system
i wrote a programe but after the 8 digits there is a period about 80 us that PORTA,0 is off then it continue
and for the simulation programe there is message that stack overflow executing call instructionthis is the pograme
if there is anyone can tell me where is the problem and how tocorrect it
; Processor Type PIC16F877A .
LIST P=16F84A
;********************************************************************************************************$
; Include An Additional File In The Program .
#INCLUDE "P16F84A.INC"
;********************************************************************************************************$
; Configuration Register Bits .
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
;********************************************************************************************************$
; Reset Vector .
org 0x00 ; Processor Reset Vector .
CBLOCK 0X20 ; here block variables
counter
cood_0
d1
ENDC ; blocking ends
GOTO Start ; Go To Beginning Of Program .
;********************************************************************************************************$
; Interrupt Vector .
org 0x04 ; Processor Interrupt Vector .
retfie
;********************************************************************************************************$
;********************************************************************************************************$
; Start of Program .
Start
banksel TRISB
movlw b'11111111'
movwf TRISB
banksel TRISA
clrf TRISA
banksel PORTA
clrf PORTA
movlw b'11111111'
movwf cood_0
PORTB_CHECK
movlw .4
movwf counter
banksel PORTB
btfsc PORTB,0
call function_0
goto PORTB_CHECK
function_0
btfss cood_0,0
call send_zero
call send_one
send_zero
banksel PORTA
BCF PORTA,0
call delay_50
rrf cood_0,f
decfsz counter,f
goto function_0
clrf PORTA
bcf STATUS,0
goto PORTB_CHECK
send_one
banksel PORTA
BSF PORTA,0
rrf cood_0,f
call delay_50
bcf PORTA,0
call delay_10
decfsz counter, 1
goto function_0
clrf PORTA
goto PORTB_CHECK
delay_50
movlw 0x0d
movwf d1
Delay_3
decfsz d1, f
goto Delay_3
return
delay_10
goto $+1
goto $+1
goto $+1
goto $+1
return
LOOP GOTO LOOP
;********************************************************************************************************$
END ; Directive 'end of program'.
**broken link removed**