在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

<menu id="6qfwx"><li id="6qfwx"></li></menu>
    1. <menu id="6qfwx"><dl id="6qfwx"></dl></menu>

      <label id="6qfwx"><ol id="6qfwx"></ol></label><menu id="6qfwx"></menu><object id="6qfwx"><strike id="6qfwx"><noscript id="6qfwx"></noscript></strike></object>
        1. <center id="6qfwx"><dl id="6qfwx"></dl></center>

            新聞中心

            EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > PIC16Fxxx的LCD驅(qū)動程序(適用于HD44780兼容的驅(qū)動器)

            PIC16Fxxx的LCD驅(qū)動程序(適用于HD44780兼容的驅(qū)動器)

            作者: 時間:2012-08-12 來源:網(wǎng)絡(luò) 收藏

            Call Delay_MS
            ;
            movlw 0x02 ; Init for 4-bit interface
            call Send_4bit
            movlw .10 ; Delay 10 mS
            Call Delay_MS
            ;
            movlw b'00000011' ; Fully Initial module
            call Send_4bit ; Sent '0011' data 4 time
            movlw .5 ; Delay 5mS
            Call Delay_MS
            movlw b'00000011'
            call Send_4bit
            call Delay_1MS ; Delay 1mS
            movlw b'00000011'
            call Send_4bit
            movlw b'00000010'
            call Send_4bit
            ;
            movlw b'00101000' ; Set 2 lines 5 x 7 dots
            call SendCmd
            movlw DISP_ON ; Turn display on (0x0C)
            call SendCmd
            movlw ENTRY_INC ; Configure cursor movement
            call SendCmd
            movlw DD_RAM_ADDR ; Set writes for display memory
            call SendCmd
            return
            ;
            ;*******************************************************************
            ;*SendChar - Sends character to *
            ;*This routine splits the character into the upper and lower *
            ;*nibbles and sends them to the , upper nibble first. *
            ;*******************************************************************
            putcLCD
            banksel Byte
            movwf Byte ; Save WREG in Byte variable
            call Delay_1MS
            swapf Byte,W ; Write upper nibble first
            andlw 0x0f
            movwf LCD_DATA
            bsf LCD_CNTL, RS ; Set for data
            bsf LCD_CNTL, E ; Clock nibble into LCD
            bcf LCD_CNTL, E
            movf Byte,W ; Write lower nibble last
            andlw 0x0f
            movwf LCD_DATA
            bsf LCD_CNTL, RS ; Set for data
            bsf LCD_CNTL, E ; Clock nibble into LCD
            bcf LCD_CNTL, E
            return
            ;
            ;*********************************************************************
            ;* To put the HEX value to LCD Display ,,
            ;* High nibble first than Low nibble
            ;* Input : W Reg.
            ;*********************************************************************
            PutHexLCD
            banksel W_BUFR
            movwf W_BUFR ; Save W Register !!
            swapf W_BUFR,W ; High nibble first !!
            call Hex2ASCII
            call putcLCD
            ;
            movf W_BUFR,W
            call Hex2ASCII
            call putcLCD
            return
            ;
            ;******************************************************************
            ;* Convert a low nibble to ASCII code
            ;* Input : W Reg.
            ;* Output: W Reg.
            ;******************************************************************
            Hex2ASCII
            andlw 0x0f ; Mask Bit 4 to 7
            movwf Hex_Bfr
            sublw .09
            btfsc STATUS,C ; If W less than A (C=1) --> only add 30h
            goto Add_W_30
            Add_W_37 movlw 0x37
            goto Hex_cont
            Add_W_30 movlw 0x30
            Hex_cont addwf Hex_Bfr,W ; The correct ASCII code for this char !!
            return
            ;
            ;*******************************************************************
            ;* SendCmd - Sends command to LCD *
            ;* This routine splits the command into the upper and lower *
            ;* nibbles and sends them to the LCD, upper nibble first. *
            ;*******************************************************************
            SendCmd
            banksel Byte
            movwf Byte ; Save WREG in Byte variable
            call Delay_1MS
            swapf Byte,W ; Send upper nibble first
            andlw 0x0f
            movwf LCD_DATA
            bcf LCD_CNTL,RS ; Clear for command
            bsf LCD_CNTL,E ; Clock nibble into LCD
            bcf LCD_CNTL,E
            movf Byte,W ; Write lower nibble last
            Send_4bit andlw 0x0f
            movwf LCD_DATA
            bcf LCD_CNTL,RS ; Clear for command

            LCD顯示屏相關(guān)文章:lcd顯示屏原理


            lcd相關(guān)文章:lcd原理


            評論


            相關(guān)推薦

            技術(shù)專區(qū)

            關(guān)閉