Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
1)org 0 ;add this why? it doesn't actually change anything...
org 0x00
goto START
org 0x04
goto ISR
2)sorry for my bad English, I can't understand what "straggle a page boundary" means, can you explain with simpler words?
All i want is to know: If String is being sent from PC and PIC goes in other delay, two level FIFO buffers are filled and if another char comes while buffer is full, something happens which I want to know.... 3 pages and noone has answered. P.S. see my file!!!! no overrun error flag is set!!!
; W = 196 (32)
; S = 160 (64)
; A = 128 (96)
; D = 96 (128)
; N = 64 (160)
list P=16F628A
include <P16F628A.INC> ;Include header file
radix dec
__config _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BODEN_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT
errorlevel -302
;disabled features -
;Code Protection (CP)
;Data Code Protection (CPD)
;Low Voltage Programming (LVP)
;Brown Out Detection (BODEN)
;External Master Clear (MCLRE)
;Watchdog Timer (WDT)
;enabled features -
;Power Up Timer (PWRTE)
;Internal Oscillator
;definitions table
#define K_win PORTA,4
#define K_ukan PORTA,3
#define K_marjvniv PORTA,2
#define K_marcxniv PORTA,1
#define K_turbo PORTA,0
;general purpose RAM location table
cblock 0x20
W_TEMP
STATUS_TEMP
T1
T2
T3
T4
T5
WRKNG
TURBOO
endc
;port initialization
org 0x00
goto Start
org 0x04
goto ISR
Start nop
banksel PCON ;set internal oscillator to 4MHz
bsf PCON,OSCF
movlw b'00000110' ;RB1(RX)=1, RB2(TX)=1, others are 0
movwf TRISB
movlw b'00011111'
movwf TRISA
;disable on chip comparator
banksel CMCON
movlw 7
movwf CMCON
;enable peripheral interrupts
movlw b'11000000'
movwf INTCON
;enable USART receive interrupt
movlw b'00100000'
movwf PIE1
; Boot Baud Rate = 9600, No Parity, 1 Stop Bit
;
movlw 0x19 ; 0x19=9600 bps (0x0C=19200 bps)
movwf SPBRG
movlw b'00100100' ; brgh = 64x, transmit enabled
banksel TXSTA ; switch to bank 1
movwf TXSTA ; enable Async Transmission, set brgh
banksel RCSTA ; switch to bank 0
movlw b'10010000' ; enable Async Reception
movwf RCSTA
call message
loop movlw 3
btfss K_win
addwf PCL,F
call Dacda_
movlw 32
call Action
movlw 3
btfss K_ukan
addwf PCL,F
call Dacda_
movlw 64
call Action
movlw 3
btfss K_marjvniv
addwf PCL,F
movlw 96
call Action
call Dacda__
movlw 3
btfss K_marcxniv
addwf PCL,F
movlw 128
call Action
call Dacda__
movlw 3
btfss K_turbo
addwf PCL,F
movlw 160
call Action
call Dacda__
goto loop
; -------------------------------------------------------------
; SEND CHARACTER IN W VIA RS232 AND WAIT UNTIL FINISHED SENDING
; -------------------------------------------------------------
;
send movwf TXREG ; send data in W
banksel TXSTA
btfss TXSTA,TRMT ; (1) transmission is complete if hi
goto $-1
banksel PORTA
return
ISR movwf W_TEMP ;back up current state of W and status registers
swapf STATUS,W
movwf STATUS_TEMP
movfw RCREG ;move received data into W
call send
movwf T1
sublw a'w'
movlw 2
btfss STATUS, Z
addwf PCL, f
movlw 32
call Action
movfw T1
sublw a's'
movlw 2
btfss STATUS, Z
addwf PCL, f
movlw 64
call Action
movfw T1
sublw a'a'
movlw 2
btfss STATUS, Z
addwf PCL, f
movlw 96
call Action
movfw T1
sublw a'd'
movlw 2
btfss STATUS, Z
addwf PCL, f
movlw 128
call Action
movfw T1
sublw a'n'
movlw 2
btfss STATUS, Z
addwf PCL, f
movlw 160
call Action
swapf STATUS_TEMP,W ;restore status and w registers to "pre-interrupt" state
movwf STATUS
movfw W_TEMP
retfie
Action iorwf PORTB,F
call Dacda
call Dacda
call Dacda
call Dacda ;<<<<<<<--------------------------------------------- THIS!!!!!!!!!!
movlw b'00011111'
andwf PORTB,F
return
Del1 movlw 30
movwf T2
decfsz T2, f
goto $-1
return
message movlw a'J'
call send
movlw a'a'
call send
movlw a'K'
call send
movlw a'o'
call send
movlw a' '
call send
movlw a'V'
call send
movlw a'0'
call send
movlw a'.'
call send
movlw a'1'
call send
movlw 0x0D
call send
return
Dacda_ call Dacda
call Dacda
call Dacda
call Dacda
return
Dacda__ movlw 50
movwf TURBOO
XAX decfsz TURBOO,F
call Dacda_
decfsz TURBOO,F
goto XAX
return
Dacda movlw 200
movwf T3
decfsz T3,F
call Del1
decfsz T3,F
goto $-3
return
END