MikroElektronika PIC Microcontrollers PIC16 Specifiche Pagina 254

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 266
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 253
mikroElektronika | Free Online Book | PIC Microcontrollers | Appendix B: Examples
bcf STATUS, RP1
; Function set (4-bit mode change)
movlw b'00100000'
movwf LCDbuf
swapf LCDbuf, w
movwf LCDportBuf
bcf LCDportBuf, RS
movf LCDportBuf, w
movwf LCDport
bsf LCDportBuf, EN
movf LCDportBuf, w
movwf LCDport
bcf LCDportBuf, EN
movf LCDportBuf, w
movwf LCDport
call Delay1ms ; 1 ms delay
; Function set (display mode set)
lcdcmd b'00101100'
call Delay1ms ; 1 ms delay
; Display ON/OFF Control
lcdcmd b'00001100'
call Delay1ms ; 1 ms delay
; Entry Mode Set
lcdcmd b'00000110'
call Delay1ms ; 1 ms delay
; Display Clear
lcdcmd b'00000001'
pausems .40 ; 40 ms delay
; Function set (4-bit mode change)
movlw b'00100000'
movwf LCDbuf
swapf LCDbuf, w
movwf LCDportBuf
bcf LCDportBuf, RS
movf LCDportBuf, w
movwf LCDport
bsf LCDportBuf, EN
movf LCDportBuf, w
movwf LCDport
bcf LCDportBuf, EN
movf LCDportBuf, w
movwf LCDport
call Delay1ms ; 1 ms delay
; Function set (display mode set)
lcdcmd b'00101100'
call Delay1ms ; 1 ms delay
; Display ON/OFF Control
lcdcmd b'00001100'
call Delay1ms ; 1 ms delay
; Entry Mode Set
lcdcmd b'00000110'
call Delay1ms ; 1 ms delay
; Display Clear
lcdcmd b'00000001'
pausems .40 ; 40 ms delay
ENDM
;**********************************************************************
; lcdcmd sends command to LCD (see the table on the previous page)
; lcdclr is the same as lcdcmd 0x01
;**********************************************************************
lcdcmd MACRO LCDcommand ; Send command to LCD
http://www.mikroe.com/en/books/picmcubook/appb/ (49 of 54)5/3/2009 11:36:02 AM
Vedere la pagina 253
1 2 ... 249 250 251 252 253 254 255 256 257 258 259 ... 265 266

Commenti su questo manuale

Nessun commento