12864LCD with Chinese character library (PIC program)

EL-C1600N100013-B
13MHZ original stock
Probe high frequency needle 10445 with line high frequency needle with 1 high frequency core can pass 3A
>#include
;__CONFIG_DEBUG_OFF&_CP_ALL&_WRT_HALF&_CPD_ON&_LVP_OFF&_BODEN_OFF&_PWRTE_ON&_WDT_OFF&_HS_OSC
; chip configuration word, watchdog off, power-on delay on, power-down detection off, low-voltage programming off, encryption, 4M crystal HS oscillation
#defineRSPORTA,5;Command/Data Selection
#DEFINERWPORTA,4; read/write selection
#DEFINEEPORTA,3;Enable signal
#DEFINEPSBPORTA, 2; parallel port / serial port selection (H / L)
#DEFINERSTPORTA,0; reset signal

;-----------------------------------------------
LCD_XEQU30H; page address
LCD_YEQU31H; Y address
COUNTEQU32H; loop count
COUNT1EQU33H; loop count
COUNT2EQU34H; loop count
COUNT3EQU35H

POINTEQU36H; lookup table offset address
POINT1EQU37H; lookup table offset address
POINT2EQU38H; lookup table offset address
POINT3EQU40H
TEMPEQU39H; temporary register
TEMP1EQU3AH; temporary register
;-----------------------------------------------
ORG0000H; reset address
NOP; empty instructions required by ICD
GOTOMAIN; jump to the main program


;********************** main program **************************
MAIN
BANKSELTRISA
CLRFTRISA; A port output
CLRFTRISD; D port output
BANKSELADCON1
MOVLW06H
MOVWFADCON1; A port is all digital port
CLRFSTATUS

BCFRST; reset LCD
CALLDELAY; delay for a while
BSFRST; clear reset signal
NOP
BSFPSB; parallel communication

;**************************initialization**********************
MOVLW30H; basic instruction operation
CALLSEND_I
MOVLW01H; clear display
CALLSEND_I
MOVLW06H; specifies the direction in which the cursor moves when writing or reading
CALLSEND_I
MOVLW0CH; On display, off cursor, not flashing
CALLSEND_I
;***********************Show Chinese characters **************************
HAN_WR2
CALLCLEAR_P; clear screen
HAN_WR2A; "Shenzhen Ganlongsheng Electronics"

CALLQUSHU
GOTO$
;************************ Write preparation*********************** *****
WR_ZB
MOVLW34H
CALLSEND_I
MOVFWLCD_Y; Y address
CALLSEND_I
MOVFWLCD_X; page address
CALLSEND_I
MOVLW30H
CALLSEND_I
RETURN

;***********************Clear screen************************ *******
CLEAR_P
MOVLW1H; clear display
CALLSEND_I
RETURN
;***********************Fetch display program ********************** *
QUSHU
CLRFPOINT; the lower address of the fetch address
CLRFPOINT+1; the address of the fetch is 8 bits high (because a total of (128/8) * 64 data is required)
CLRFPOINT2; temporary register of POINT
CLRFPOINT3; temporary register of POINT+1

MOVLW02H; the whole screen is divided into two small screens (32 lines per small screen)
MOVWFCOUNT3
MOVLW80H; starting address of the upper half of the screen
MOVWFLCD_X
QUSHU1
MOVLW80H; the address of the first byte of each line
MOVWFLCD_Y
MOVLW20H; 32 lines per small screen
MOVWFCOUNT2
QUSHU2
MOVLW10H; 16 bytes per line (16*8=128)
MOVWFCOUNT1
CALLWR_ZB; call write preparation function
QUSHU3
CALLTAB1; look up the table
CALLSEND_D; written to the GDROM of the LCD
CLRFPOINT3
INCFPOINT, 1; offset address plus 1, find the next data
BTFSCSTATUS, Z; whether there are overflows in the lower 8 bits
INCFPOINT+1,1; Yes, high 8 digits +1
DECFSZCOUNT1, 1; whether to write a line of 16 bytes
GOTOQUSHU3; No, go back and continue writing
INCFLCD_Y, 1; Yes, write a line
DECFSZCOUNT2, 1; whether to write 32 lines
GOTOQUSHU2; No, continue to write
MOVLW88H; Yes, write half screen
MOVWFLCD_X
DECFSZCOUNT3, 1; whether to write the lower half of the screen
GOTOQUSHU1; No, continue to write
; yes, open display
MOVLW36H; extended instruction, graphic display on
CALLSEND_I
MOVLW30H; basic instructions
CALLSEND_I
RETURN

;************************ Send data to LCD********************* **
; write data subroutine
;RS=1, RW=0, E=high pulse, D0-D7=data
;************************************************* *********
SEND_D
MOVWFTEMP1; temporary data
CALLCHK_BUSY; determine if the bus is busy
BSFRS
BCFRW
MOVFWTEMP1
MOVWFPORTD; send data
BSFE
NOP
NOP
BCFE
RETURN
;************************ Send commands to LCD********************* **
; write instruction subroutine
;RS=0, RW=0, E=high pulse, D0-D7=execution code
;************************************************* *********
SEND_I
MOVWFTEMP1; staging command
CALLCHK_BUSY; determine if the bus is busy
BCFRS
BCFRW
MOVFWTEMP1
MOVWFPORTD; send command
BSFE
NOP
NOP
BCFE
RETURN
;************************Check if the bus is busy **********************
; measuring busy subroutine
;RS=0, RW=1, E=H, D0-D7=Status Word
;************************************************* *********
CHK_BUSY
BANKSELTRISD
MOVLW0FFH
MOVWFTRISD; D port is set to input
CLRFSTATUS
MOVLW0FFH
MOVWFPORTD
BCFRS
BSFRW
CHECK_BUSY_1
NOP
NOP
NOP
BSFE
NOP
NOP
NOP
BTFSSPORTD, 7; D7 is high for bus busy, low for bus idle
GOTO$+6
NOP
NOP
NOP
BCFE
GOTOCHECK_BUSY_1
BCFE
BANKSELTRISD
CLRFTRISD; restore D port as output
CLRFSTATUS
RETURN
;***************************Delay program******************* ********
DELAY
MOVLW0afH
MOVWF20H
MOVLW0ffh
MOVWF21H
DECFSZ21H, 1
GOTO$-1
DECFSZ20H, 1
GOTO$-5
RETURN
;***************************Delay program 1****************** ********
; display flashing
DELAY1
MOVLW05H
MOVWF22H
CALLDELAY
DECFSZ22H, 1
GOTO$-2
RETURN

;***************************Data Form******************** ******
TAB1
MOVLWLOW(TAB1A); Get the lower 8-bit address of the data header
ADDWFPOINT, 0; and take the lower 8 bits of the number
MOVWFPOINT2; dumped to POINT2
BTFSCSTATUS, C; determine if the lower 8 bits have overflow
INCFPOINT3,1;Yes, high 8 digits +1
MOVLWHIGH(TAB1A); Get the upper 8-bit address of the data header
ADDWFPOINT3,0
ADDWFPOINT+1,0; and the upper 8 bits of the number

MOVWFPCLATH; prepare the top 5 of the PC
MOVFWPOINT2
MOVWFPCL; prepare the lower 8 bits of the PC
TAB1A:; data sheet
DT0X0F, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XC0, 0X00, 0X00
DT0X18, 0XFC, 0XB7, 0X80, 0X00, 0X00, 0X00, 0X00, 0X00, 0X00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0XDF, 0XFC, 0X00, 0X1F, 0XFE, 0X60, 0X06, 0X60
DT0X1F, 0X80, 0X00, 0X03, 0X80, 0X80, 0XC0, 0X01, 0XFF, 0XF8, 0X00, 0X0F, 0X3F, 0XE0, 0X0F, 0XE0

DT0X1C, 0X00, 0X00, 0X01, 0X80, 0X41, 0XC0, 0X06, 0XFF, 0XF8, 0X00, 0X00, 0XF3, 0XE0, 0X00, 0X00
DT0X13, 0XFC, 0X00, 0X03, 0XFC, 0X41, 0XFC, 0X03, 0X7F, 0XF0, 0X00, 0X00, 0X0F, 0XE0, 0X00, 0X00

DT0X1F, 0XFF, 0X00, 0X03, 0XFE, 0X40, 0XFF, 0X00, 0XFF, 0XF0, 0X00, 0X07, 0XFF, 0XE0, 0X07, 0XC0
DT0X1F, 0XC0, 0X00, 0X02, 0XF0, 0X40, 0XE1, 0X00, 0X78, 0XF0, 0X00, 0X3C, 0XFC, 0X20, 0X0C, 0X60
DT0X1E, 0X00, 0X00, 0X02, 0XC0, 0XC0, 0X60, 0X00, 0XF3, 0X70, 0X00, 0X03, 0XFF, 0XE0, 0X00, 0X60
DT0X10,0X00,0X00,0X02,0X00,0X80,0X60,0X00,0X67,0X30,0X00,0X00,0X7F,0XE0,0X00,0XC0
DT0X17, 0XFF, 0X00, 0X03, 0X01, 0X80, 0X30, 0X00, 0XFC, 0XB0, 0X00, 0X3F, 0XCF, 0XE0, 0X01, 0X80
DT0X1F, 0XFA, 0X00, 0X03, 0X03, 0X80, 0X18, 0X01, 0XFC, 0X70, 0X00, 0X3C, 0X8F, 0XE0, 0X03, 0X00
DT0X1F, 0XB0, 0X00, 0X03, 0X0F, 0X00, 0X0C, 0X02, 0XFE, 0X30, 0X00, 0X0D, 0X3F, 0X60, 0X06, 0X00
DT0X1F, 0X00, 0X00, 0X03, 0X0F, 0X00, 0X04, 0X05, 0XEE, 0X30, 0X00, 0X03, 0XDF, 0X20, 0X0C, 0X00
DT0X1C, 0X00, 0X00, 0X02, 0X01, 0X06, 0X00, 0X07, 0XE3, 0X30, 0X01, 0X00, 0XDF, 0XE0, 0X0C, 0X60
DT0X10,0X1E,0X00,0X03,0X03,0X03,0X80,0X07,0XF1,0X30,0X00,0XE0,0X33,0XE0,0X0F,0XE0

DT0X1F, 0XEC, 0X00, 0X02, 0X03, 0X01, 0XE0, 0X09, 0XF0, 0X60, 0X00, 0X3C, 0X8E, 0X60, 0X00, 0X00
DT0X1F, 0X30, 0X00, 0X03, 0X03, 0X9D, 0X30, 0X13, 0XFC, 0X60, 0X00, 0X1F, 0X3F, 0XA0, 0X00, 0X00

DT0X1F, 0XC1, 0X8C, 0X02, 0X81, 0XF3, 0X10, 0X0F, 0XF0, 0XC0, 0X03, 0X87, 0XC7, 0XE0, 0X03, 0X80
DT0X1A, 0X06, 0X30, 0X03, 0X03, 0X80, 0X08, 0X13, 0XE0, 0XC0, 0X00, 0XE3, 0XF1, 0XE0, 0X06, 0XC0
DT0X1C, 0X1C, 0X40, 0X01, 0X82, 0X00, 0X04, 0X0F, 0XE1, 0X80, 0X00, 0X78, 0XFE, 0X60, 0X0C, 0X60
DT0X13, 0XF8, 0X80, 0X01, 0X46, 0X00, 0X00, 0X07, 0XE3, 0X00, 0X00, 0X3E, 0X7F, 0XE0, 0X0C, 0X60
DT0X1F, 0X63, 0X00, 0X01, 0X8C, 0X00, 0X00, 0X07, 0XFE, 0X00, 0X00, 0X0F, 0X9F, 0XE0, 0X0D, 0X60
DT0X1F, 0X8E, 0X04, 0X01, 0X47, 0XEE, 0X00, 0X07, 0XFE, 0X00, 0X00, 0X87, 0XEF, 0XE0, 0X0D, 0X60
DT0X1E, 0X3C, 0X1C, 0X00, 0XA7, 0XFF, 0X8C, 0X03, 0XF8, 0X00, 0X00, 0XC1, 0XFF, 0XE0, 0X0C, 0X60
DT0X1F, 0X78, 0X38, 0X00, 0XC3, 0X93, 0X8E, 0X07, 0XF0, 0X00, 0X00, 0X78, 0X7F, 0XE0, 0X0C, 0X60
DT0X1F, 0XF1, 0X60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1F, 0XF7, 0XFE, 0X40, 0X02, 0XFF, 0XFF, 0XF9, 0XFF, 0XFF, 0X00, 0X0F, 0X3F, 0XE0, 0X06, 0XC0
DT0X1F, 0XFF, 0XFC, 0X88, 0X06, 0XFF, 0XFD, 0XF3, 0XFF, 0XFF, 0XC1, 0X8F, 0X9F, 0XE0, 0X03, 0X80

DT0X1F, 0XFF, 0XB9, 0X38, 0X0E, 0XFE, 0X71, 0XE7, 0XFF, 0XFF, 0XE8, 0XC3, 0XEF, 0XE0, 0X00, 0X00
DT0X0F, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XFF, 0XC0, 0X00, 0X00
;***************************End of source program******************* *****
End

Distribution Boxes

The distribution box is a massive parameter on the data. Generally, it constitutes a low-voltage forest. According to the electrical wiring, it is required to assemble the switchgear, measuring instrument, protective electrical appliance and auxiliary equipment in a closed or semi-closed metal cabinet or on the screen to form a low-voltage power distribution. box. The circuit can be switched on or off with a manual or automatic switch during normal operation.

Our company's Distribution Boxes are mainly divided into six series(as follow),had exported into global market for many years:

Universal Junction Boxes
Euro type Switch Boxes
Distribution Box
Locks for Switch Boxes
Industrial Plug And Socket
JXF Water Proof Metallic Panel Board

Tsm Flush Mounting Plastic EnclosureHt Type Distribution Box 8ways


Distribution Boxes,Terminal Box,Switch Box,Control Switch Box

Ningbo Bond Industrial Electric Co., Ltd. , https://www.bondelectro.com

Posted on