This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RS-232 protocol

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#include<p16f877a.inc>

__config _XT_OSC & _WDT_OFF & _PWRTE_OFF & _BODEN_OFF & _WRT_OFF & _DEBUG_OFF

bsf STATUS,5

movlw b'00000110' ; SPBRG value acc to baud Rate=6 & baud rate-9600,FOSC-4MHz
movwf SPBRG
bcf TXSTA,BRGH ;speed low
bcf TXSTA,SYNC ; Asynchro
;bcf TRISC,7
;bcf TRISC,6

bcf STATUS,5
bsf RCSTA,SPEN ;Serial Port Enable

bsf STATUS,5
bsf TXSTA,TX9 ; 9 bit data enable
bsf TXSTA,TXEN ;Transmision Enable

movlw b'00101001' ; 8 bit data 00101001

bcf STATUS,5
movwf TXREG

bsf STATUS,5
bsf TXSTA,TX9D ; 9th bit

delay decfsz 20h,1 goto delay

bcf TXSTA,TXEN

bcf STATUS,5

bcf RCSTA,SPEN

end

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Above is my assembly code for sending a number '297' through Serial Port of an pic16f877A microcontroler
but when i load this to proteus and check by virtual terminal.. i got a totally different symbol continuously øøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøøø....... what is the reason please help me friends

0