PA3040
Advanced Member level 3
- Joined
- Aug 1, 2011
- Messages
- 883
- Helped
- 43
- Reputation
- 88
- Reaction score
- 43
- Trophy points
- 1,308
- Activity points
- 6,936
char_loader equ 0x20 ;bank 0
LIST P=P16F877
#include <p16f877a.inc>
__config 3f39
org 0x000
start goto main
main call sys_init
loop call load_char
goto loop
load_char movlw 'T'
movwf char_loader
call send_char
movlw 'E'
movwf char_loader
call send_char
movlw 'S'
movwf char_loader
call send_char
movlw 'T'
movwf char_loader
call send_char
movlw '1'
movwf char_loader
call send_char
movlw '2'
movwf char_loader
call send_char
movlw '3'
movwf char_loader
call send_char
return
send_char btfss PIR1,TXIF ;Check the USART transmit buffer is empty
goto $-1
movf char_loader,w
movwf TXREG
return
sys_init bsf STATUS,5
movlw b'00000000'
movwf TRISC
movlw 0x11
movwf SPBRG ; Set Baud rate 9600bps
movlw b'10100000' ; 8-bit transmit, transmitter enabled,
movwf TXSTA ; asynchronous mode, low speed mode
bcf STATUS,5
bsf RCSTA,SPEN ;Serial port enabled
;(configures RC7/RX/DT and
;RC6/TX/CK pins as serial port pins)
return
end
Maybe your baudrate settings are wrong. In proteus double click Virtual terminal and choose different baudrates and see. If you are getting something on Virtual termainal then it means PIC is transmitting the data.
;for BRGH = 0, baudrate = 9600
movlw 0x06
movwf SPBRG ; Set Baud rate 9600bps
movlw b'10100000' ; 8-bit transmit, transmitter enabled,
movwf TXSTA
;for BRGH = 1, baudrate = 9600
movlw 0x19
movwf SPBRG ; Set Baud rate 9600bps
movlw b'10100100' ; 8-bit transmit, transmitter enabled,
movwf TXSTA
Maybe it is a Proteus bug
char_loader equ 0x20
char_reciver equ 0x21
LIST P=P16F877A
#include <p16f877a.inc>
__config 3f39
org 0x000
start goto main
main call sys_init
loop call load_char
call reci_char
;call display
goto loop
load_char movlw 'T'
movwf char_loader
call send_char
movlw 'E'
movwf char_loader
call send_char
movlw 'S'
movwf char_loader
call send_char
movlw 'T'
movwf char_loader
call send_char
movlw '1'
movwf char_loader
call send_char
movlw '2'
movwf char_loader
call send_char
loop1 ;nop
; goto loop1
return
send_char btfss PIR1,TXIF ;Check the USART transmit buffer is empty
goto $-1
movf char_loader,w
movwf TXREG
return
reci_char btfss PIR1,RCIF
goto $-1
movf RCREG,W
movwf PORTB
return
sys_init clrf PORTB
bsf STATUS,5
movlw b'00000000'
movwf TRISC
movlw .25
movwf SPBRG ; Set Baud rate 9600bps
movlw b'10100100' ; 8-bit transmit, transmitter enabled,
movwf TXSTA ; asynchronous mode, low speed mode
clrf TRISB
bcf STATUS,5
bsf RCSTA,SPEN ;Serial port enabled
;(configures RC7/RX/DT and
;RC6/TX/CK pins as serial port pins)
movlw b'10010000'
movwf RCSTA
return
end
reci_char [COLOR="#FF0000"]btfss PIR1,RCIF[/COLOR];RCIF: USART Receive Interrupt Flag bit
goto $-1
movf RCREG,W
movwf PORTB
return
Note: Individual interrupt flag bits are set regardless
of the status of their corresponding mask bit or the GIE bit.
reci_char btfss PIR1,RCIF;RCIF: USART Receive Interrupt Flag bit
goto $-1
movf RCREG,W
movwf PORTB
return
Use ReatTerm
Currently, release versions of PuTTY tools only run on full Win32 systems and Unix. ‘Win32’ includes versions of Windows from Windows 95 onwards (as opposed to the 16-bit Windows 3.1; see question A.3.5), up to and including Windows 7; and we know of no reason why PuTTY should not continue to work on future versions of Windows.
The Windows executables we provide are for the 32-bit ‘x86’ processor architecture, but they should work fine on 64-bit processors that are backward-compatible with that architecture. (We used to also provide executables for Windows for the Alpha processor, but stopped after 0.58 due to lack of interest.)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?