Hi.
I have my code working using this code off microchip:
However, I need to use this supplied code:
Are these codes comparible to the point where I could simply drop the second in as a replacement for the first? For example, ive highlighed the lines in the first code which dont appear in the second code in red. Also, is the settling time needed?
Any input on this would be very helpful, thank you.
I have my code working using this code off microchip:
Code:
movlw .25 ;
[COLOR="red"] banksel SPBRG[/COLOR]
movwf SPBRG
movlw b'00100100' ; brgh = high (2)
[COLOR="red"] banksel TXSTA
[/COLOR] movwf TXSTA ; enable Async Transmission, set brgh
bcf STATUS,RP0 ; RAM PAGE 0
movlw b'10010000' ; enable Async Reception
[COLOR="red"] banksel RCSTA[/COLOR]
movwf RCSTA
;
; ------------------------------------
; PROVIDE A SETTLING TIME FOR START UP
; ------------------------------------
;
[COLOR="red"] clrf dataL
settle decfsz dataL,F
goto settle
banksel RCREG
movf RCREG,W
movf RCREG,W
movf RCREG,W ; flush receive buffer[/COLOR]
return
However, I need to use this supplied code:
Code:
movlw b'00100100'
movwf TXSTA ; setup 8 bit serial transmission, high baud rate
movlw .25
movwf SPBRG ; set baudrate 9,600
bcf STATUS,RP0 ; select Bank 0
movlw b'10010000'
movwf RCSTA ; enable serial port, and continuous reception
return
Are these codes comparible to the point where I could simply drop the second in as a replacement for the first? For example, ive highlighed the lines in the first code which dont appear in the second code in red. Also, is the settling time needed?
Any input on this would be very helpful, thank you.
Last edited: