Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list P=16F877
- status equ 0x03
- portd equ 0x08
- trisd equ 0x88
- RP0 equ 0x05
- En equ 0x01
- Timer1 equ 0x20
- Timer2 equ 0x21
- Times equ 0x23
- TabPek equ 0x24
- ASCII equ 0x25
- Z equ 0x02
- PCL equ 0x02
- ;**********************
- org 0x00
- clrf status
- movlw 0x00
- movwf 0x0A
- goto Init
- ;******** Subrutiner
- waitms movlw 0x0a
- movwf Timer2
- wait_loop2 movlw 0x64
- movwf Timer1
- wait_loop1 decfsz Timer1,1
- goto wait_loop1
- decfsz Timer2,1
- goto wait_loop2
- return
- ; ********* Enable
- Enable bsf portd,En
- call waitms
- bcf portd,En
- call waitms
- return
- ;*********** LCD_Init
- LCD_Init movlw 0xff
- movwf Times
- lcd_loop3 call waitms
- decfsz Times,1
- goto lcd_loop3
- movlw 0x30
- movwf portd
- call Enable
- movlw 0x05
- movwf Times
- lcd_loop4 call waitms
- decfsz Times,1
- goto lcd_loop4
- movlw 0x30
- movwf portd
- call Enable
- call waitms
- movlw 0x30
- movwf portd
- call Enable
- movlw 0x20
- movwf portd
- call Enable
- call waitms
- movlw 0x20
- movwf portd
- call Enable
- movlw 0x80
- movwf portd
- call Enable
- call waitms
- movlw 0x00
- movwf portd
- call Enable
- movlw 0x10
- movwf portd
- call Enable
- call waitms
- movlw 0x00
- movwf portd
- call Enable
- movlw 0x60
- movwf portd
- call Enable
- call waitms
- movlw 0x00
- movwf portd
- call Enable
- movlw 0xe0
- movwf portd
- call Enable
- call waitms
- return
- ;********* Text tabellen
- TEXT
- addwf PCL,f
- retlw 'A'
- retlw 'B'
- retlw 'C'
- retlw 'D'
- retlw 'E'
- retlw 'F'
- retlw 'G'
- retlw 0x00
- return
- VisaLCD
- movwf ASCII
- andlw 0xF0
- movwf portd
- bsf portd,0
- call Enable
- swapf ASCII,w
- andlw 0x0F
- movwf portd
- incf portd,f
- call Enable
- return
- ;********* Init
- Init clrw
- movwf portd
- bsf status,RP0
- movwf trisd
- bcf status,RP0
- Main call LCD_Init
- clrf TabPek
- Igen movfw TabPek
- call TEXT
- iorlw 0x00
- btfsc status, Z
- goto Klar
- call VisaLCD
- incf TabPek
- goto Igen
- Klar goto Klar
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement