Digole Graphic LCD Driver

srnet

Senior Member
The attached picture is my portable LCD display, its used for the reception and display of data from RFM22 data packets.

There is a single cell Lipo in the box and a small 3-5V up converter powering the LCD so that the contrast stays constant as the battery ages.

The unit contains a PICAXE 28X2 board and the Digole 'Universal Serial:UART/IIC/I2C/SPI Adapter for 128x64 LCD' this uses a cheap 128x64 graphic LCD for the display of text in various font sizes and graphics too.

Driven in UART mode (the supplied default) using serout commands on the PICAXE.

With the PICAXE running at 64MHz and a baud rate of 38400, the entire screen clear and write of the 7 lines takes 62mS, with no added program delays.

Code:
'Digole LCD Test Program for Universal Serial:UART/IIC/I2C/SPI Adapter for 128x64 graphic LCD
'Using JE AN 1286404 LCD
'Stuart Robinson - August 2013

#picaxe 28x2
#no_data

symbol var1 = b4
symbol var2 = b5
symbol loopv1 = b14		'loop counter
symbol wvar1 = w27

symbol baudLCD = T9600_64    	'baud settings for serout TX, baud for LCD at startup
symbol baudLCD64 = T38400_64  'baud settings for serout TX, baud for faster LCD baud rate
symbol TXLCD = b.5		'I/O pin for driving LCD
symbol PXLED = a.3  		'Pin to drive LED on PCB
symbol linedelay = 0


main:
	setfreq em64						'switch to 64Mhz
	
	pause 400							'short pause (50ms) to allow LCD to be ready			
	SerOut TXLCD, baudLCD,("DSS",0) 			'Turn start welcome screen off
	pause 400							'short pause (50ms) to allow LCD to be ready
	SerOut TXLCD, baudLCD,("DC",0)			'Turn config message off
	pause 400							'short pause (50ms) to allow LCD to be ready
	SerOut TXLCD, baudLCD,("SB38400",0)			'Set baud rate from 9600 default
		
loop1:
	high PXLED
	gosub clearLCD

	gosub Home1LCD
	serout TXLCD, baudLCD64, ("TTDisplay Ready",CR)

	gosub home2LCD
	serout TXLCD, baudLCD64, ("TT012345678901234567890",CR)

	gosub home3LCD
	serout TXLCD, baudLCD64, ("TTLine 3 ABCDEFGHIJKLMN",CR)

	gosub home4LCD
	serout TXLCD, baudLCD64, ("TTLine 4 ABCDEFGHIJKLMN",CR)

	gosub home5LCD
	serout TXLCD, baudLCD64, ("TTLine 5 ABCDEFGHIJKLMN",CR)

	gosub home6LCD
	serout TXLCD, baudLCD64, ("TTLine 6 ABCDEFGHIJKLMN",CR)

	gosub home7LCD
	serout TXLCD, baudLCD64, ("TTLine 7 ABCDEFGHIJKLMN",CR)
	low PXLED	

	pause 16000
	
	goto loop1	



	
'************************************************************************************
'Start LCD Routines for Digole Serial LCD
'************************************************************************************


backlighton:
	'turn on backlight
	SerOut TXLCD, baudLCD64,("BL",1) 	


backlightoff:
	'turn off backlight
	SerOut TXLCD, baudLCD64,("BL",0) 
return	



ClearLCD:
	'clear display
	SerOut TXLCD, baudLCD64,("CL") 	'Clear LCD 240 x 64 pixels, 
	SerOut TXLCD, baudLCD64,("SF",10) 	'set font to size 10
return



Home1LCD:	
	'set cursor start of line 1
	SerOut TXLCD, baudLCD64,("TP",0,0)  	
return



Home2LCD:  
	'set cursor start of line 2
	SerOut TXLCD, baudLCD64,("TP",0,1) 	 
return



Home3LCD:  
	'set cursor start of line 3
	SerOut TXLCD, baudLCD64,("TP",0,2) 	 
return



Home4LCD:  
	'set cursor start of line 4
	SerOut TXLCD, baudLCD64,("TP",0,3) 	 
return



Home5LCD:  
	'set cursor start of line 5
	SerOut TXLCD, baudLCD64,("TP",0,4) 	 
return



Home6LCD:  
	'set cursor start of line 6
	SerOut TXLCD, baudLCD64,("TP",0,5) 	 
return



Home7LCD:  
	'set cursor start of line 7
	SerOut TXLCD, baudLCD64,("TP",0,6) 	 
return



'************************************************************************************
'END LCD Routines 
'************************************************************************************
 

Attachments

Top