射灯厂家
免费服务热线

Free service

hotline

010-00000000
射灯厂家
热门搜索:
行业资讯
当前位置:首页 > 行业资讯

LCD驱动HT1621的PIC单片机源代码

发布时间:2020-06-30 18:44:51 阅读: 来源:射灯厂家

STATUS EQU 3HFSR EQU 4HRB EQU 6HRC EQU 7HOPTIONA EQU 81HTRISB EQU 86HTRISC EQU 87H

GENR0 EQU 053HGENR1 EQU 054HWD_RG EQU 055HDA_AG0 EQU 056H ;SEG0 SEG1DA_AG8 EQU 05EH ;SEG16 SEG17;.............................C EQU 0Z EQU 2RP0 EQU 5RP1 EQU 6 CS EQU 2 WDA EQU 5 ;RC,5数据线WCLK EQU 1 ;RB,1写时钟线RCLK EQU 4 ;RB,4读时钟线;..............................ORG 0HGOTO START;...............................START BSF STATUS,RP0 MOVLW 00H MOVWF TRISB MOVLW 81H MOVWF TRISC BCF STATUS,RP0 MOVLW 12H MOVWF RB BSF RC,2 BSF RC,5 MOVLW 4 MOVWF OPTIONALOOP NOP CALL X_QUAN NOP GOTO LOOP

;............................X_QUAN MOVLW 8H CALL ON_LCD ;TRANSMIT TH1621 WORK MODE VALUE MOVLW 9H ;显示9位LCD CALL DIS_DATA RETURN;............................ON_LCD MOVWFGENR1 BCF RC,2 MOVLW80H ;HI_W3 BITS:100MOVWFWD_RG MOVLW3 ;3位命令100CALLTRAM_DATA ON_LCD0MOVFGENR1,0CALLON_VALUE ;查表初始化LCDMOVWFWD_RG

MOVLW8 ;送8位查表值CALLTRAM_DATA BCF RC,WDA NOP NOP BCF RB,1 NOP NOP BSF RB,1 BSF RC,2 DECFSZGENR1,1GOTOON_LCD+1 RETURN;........................ON_VALUEADDWF2 NOPRETLW03H;LCD ONRETLW01H;SYS ON

RETLW08H;TONE OFFRETLW29H;BISA1/3 4 COM RETLW18H;256K RETLW05H;WDT DISABLE

RETLW80H;/IRQ DISABLE *RETLW0E3H;NORMAL MODE *

;................................;TRANSMIT BITS SUBROUTINETRAM_DATA BCF STATUS,0 MOVWFGENR0 BCFRB,1 RLFWD_RG BTFSS3,0GOTO$+3BSFRC,WDAGOTO$+2BCFRC,WDA BSFRB,1 DECFSZGENR0,1GOTOTRAM_DATA+2 RETURN;.......................DIS_DATA MOVWFGENR1 ;9位LCD BCF RC,2 MOVLW0A0HMOVWFWD_RG;WRITE CONTROL

MOVLW3H ;3位写命令101CALLTRAM_DATA MOVLW00MOVWFWD_RG;WRITE ADDRESSMOVLW6H ;6位地址 CALLTRAM_DATA ; DIS_DATA0MOVLW0FFHMOVWFWD_RG;DISPLAY CODE

MOVLW8 ;8段数据CALLTRAM_DATA

DECFSZGENR1,1GOTODIS_DATA0 BSF RC,2 RETLW0 END

淄博防静电工服订做

淄博防静电工服订制

石家庄防静电工作服定制

相关阅读