Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list p=16f84a
- #include p16f84a.inc
- msek equ 0Ch
- TMP equ 0Dh
- adres equ 0Eh
- porta equ 0x05
- portb equ 0x06
- TRISA equ 0x85
- TRISB equ 0x86
- status equ 0x03
- RP0 equ 5
- #define E porta,1
- #define RS porta,0
- org 0
- goto start
- wys_strona
- movlw 0
- movwf adres
- et_wys call strona
- call 0
- bcfss 2
- return
- strona movfw 80h
- call wrcmd
- movfw 'K'
- call wrdata
- movlw 'r'
- call wrdata
- return
- delay_100
- movwf msek
- bsf status,RP0
- movlw b'00000100'
- et_del_1
- bcf status, RP0
- clrf TMR0
- et_del_2
- movlw d'100'
- bcf status, RP0
- subwf TMR0,W
- btfss C,5
- goto et_del_2
- decfsz msek,f
- goto et_del_1
- return
- iniLCD movlw .50
- call delay_msek
- BCF RS
- BSF E
- movlw b'00000011'
- movwf PORTB
- bcf E
- movlw .5
- call delay_msek
- bsf E
- nop
- nop
- bcf E
- call delay_100
- bsf E
- nop
- nop
- bcf E
- call delay_100
- movlw b'00101000'
- call wrcmd
- movlw b'00001000'
- call wrcmd
- movlw b'00000001'
- call wrcmd
- movlw b'00000110'
- call wrcmd
- movlw b'11000000'
- call wrcmd
- return
- wrdata bsf RS
- goto at_write
- wrcmd bcf RS
- at_write
- movwf TMP
- bsf E
- swapf TMP,f
- movlw 0f0h
- iorwf TMP ,w
- movlw w ,PORTB
- bcf E
- nop
- nop
- bsf E
- swapf TMP,w
- iorwf 0f0h
- movwf PORTB
- bcf E
- btfsc RS
- goto at_data
- movlw .2
- call delay_msek
- return
- at_data
- call delay_100
- return
- delay_msek
- movwf msek
- bsf status,RP0
- movlw b'00000100'
- et_delay_1
- bcf status, RP0
- clrf TMR0
- et_delay_2
- movlw d'200'
- bcf status, RP0
- subwf TMR0,W
- btfss C,5
- goto et_delay_2
- decfsz msek,f
- goto et_delay_1
- return
- start
- bsf RP0,5
- movfw b'11110000'
- movwf TRISB
- movwf TRISA
- bcf RP0,5
- call iniLCD
- movfw 80h
- call wrcmd
- call wys_strona
- movlw 0Ch
- call wrcmd
- end
Add Comment
Please, Sign In to add comment