Code: Select all
Device = 18F2525
Clock = 40 ' external crystal x 4
//Config OSC = HSPLL ' Config OSC = HSPLL
#Option GLCD_SCREEN_WIDTH = 192
#Option GLCD_SCREEN_HEIGHT = 64
#Option GLCD_DATA = PORTB
#Option GLCD_RS = PORTA.3
#Option GLCD_CS1 = PORTA.4
#Option GLCD_CS2 = PORTA.5
#Option GLCD_CS3 = PORTC.6
#Option GLCD_RW = PORTA.2
#Option GLCD_EN = PORTA.1
#Option GLCD_RST = PORTA.0
//#Option GLCD_INIT_DELAY = 500
//#Option GLCD_INVERT_CS = False
#Option GLCD_MODEL = KS0108
Include "GLCD.bas"
Include "FixedFont.bas"
Include "Arial.bas"
Include "Garamond.bas"
Include "Tahoma.bas"
Include "Verdana.bas"
Include "Times.bas"
Include "DS1307.bas"
Include "convert.bas"
Include "utils.bas"
Include "graphics.bas"
Include "ks0108.bas"
Include "ISRRX.bas"
Include "usart.bas"
Dim i As Byte
ADCON1 = $07 // PORTE as digital (GLCD)
SetAllDigital()
GLCD.Cls
GLCD.SetFont(Fixed)
GLCD.WriteAt(4,2,"RESET")
DelayMS(500)
Cls
SetBaudrate(br9600)
// read in characters and echo to screen...
Repeat
While ISRRX.DataAvailable
i = ISRRX.ReadByte()
USART.WriteByte(i)
GLCD.WriteAt(10,10,DecToStr(i) + " TEST")
DelayMS(200)
Wend
Until 1=0
The GLCD displays [230 TEST 241 TEST 137 TEST 97 TEST 43 TEST .....]