;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #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
a string of 'U*' (capital U) will create a perfect square wave with a frequency of half the baudrate.
If 8 data bits, one stop and no parity.
Result would vary with changes in some combinations of those settings.