專(zhuān)注差異化嵌入式產(chǎn)品解決方案 給智能產(chǎn)品定制注入靈魂給予生命
提供開(kāi)發(fā)工具、應(yīng)用測(cè)試 完善的開(kāi)發(fā)代碼案例庫(kù)分享
從全面的產(chǎn)品導(dǎo)入到強(qiáng)大技術(shù)支援服務(wù) 全程貼心伴隨服務(wù),創(chuàng)造無(wú)限潛能!
提供新的芯片及解決方案,提升客戶(hù)產(chǎn)品競(jìng)爭(zhēng)力
提供最新的單片機(jī)資訊,行業(yè)消息以及公司新聞動(dòng)態(tài)
十年專(zhuān)注單片機(jī)方案開(kāi)發(fā)的方案公司英銳恩,分享基于PIC單片機(jī)的128*64(ST7920)的液晶PIC程序。英銳恩現(xiàn)提供服務(wù)產(chǎn)品涉及主控芯片:8位單片機(jī)、16位單片機(jī)、32位單片機(jī)及各類(lèi)運(yùn)算放大器等。
list p=16F84A ; list directive to define processor
#include ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC
; '__CONFIG' directive is used to embed configuration data within .asm file.
; The lables following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.
;***** VARIABLE DEFINITIONS
cblock 0X0c
w_temp
status_temp
TEMP1
TEMP2
TEMP3
TEMP4
TEMP5
START
COM
HDATA
LDATA
DATA8
DATACOUNT
index:2
indexback;真實(shí)的表中的序號(hào)
endc
#define CS PORTA,0 ;又名RS腳.
#define SID PORTA,1 ;又名R/W腳.
#define SCLK PORTA,2 ;又名E腳.
;**********************************************************************
ORG 0x000 ; processor reset vector
goto main ; go to beginning of program
main
MOVLW 00H
banksel TRISA
MOVWF TRISA
banksel PORTA
MOVLW 00H
MOVWF PORTA
;寫(xiě)指令前,先對(duì)START賦值0XF8,寫(xiě)數(shù)據(jù)前先對(duì)START賦值0XFA
pagesel INILCM
CALL INILCM
MOVLW 0XF8
banksel START
MOVWF START
MOVLW 0X80;設(shè)定DDRAM位址到位址計(jì)數(shù)器。
banksel COM
MOVWF COM
pagesel WRITE
CALL WRITE
MOVLW 0XFA
banksel START
MOVWF START
;*********************************用戶(hù)程序
;顯示全部文字:
movlw 0X00;從第0個(gè)數(shù)開(kāi)始取數(shù)。
banksel index
MOVWF indexback
DISPLAYLOOP:
MOVLW 0X00
MOVWF index+1
MOVF indexback,0
MOVWF index
pagesel LWORDTABLE
call LWORDTABLE
banksel COM
MOVWF COM
pagesel WRITE
CALL WRITE
INCF indexback
movf indexback,0
ADDLW low(wordtablestart)
XORLW low(wordtableend)
SKPZ
GOTO DISPLAYLOOP
; MOVLW 0xb5
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xc4
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xc3
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xfb
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xd7
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xd6
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xbd
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xd0
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xba
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xab
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xc7
; MOVWF COM
; pagesel WRITE
; CALL WRITE
; MOVLW 0xef
;MOVWF COM
; pagesel WRITE
;CALL WRITE
;MOVLW 0xbb
;MOVWF COM
;pagesel WRITE
;CALL WRITE
; MOVLW 0xb3
; MOVWF COM
;pagesel WRITE
; CALL WRITE
;0xc4,0xc3,0xfb,0xd7,0xd6,0xbd,0xd0,0xba,0xab,0xc7,0xef,0xbb,0xb3
pagesel