I'm sending data from a PICAXE 20x2 to a 18F2525 then to a GLCD.
As an example the PICAXE is sending the following
Code: Select all
hserout 0,(17,Statusb0,Statusb1)
hserout 0,(23,"PT")
hserout 0,(24,"T ")
hserout 0,(25," E")
hserout 0,(26,"RR") 'Send "PTT ERR" Message to Display
hserout 0,(17,Statusb0,Statusb1)
hserout 0,(18,FWDPWRb0,FWDPWRb1)
hserout 0,(19,REVPWRb0,REVPWRb1)
hserout 0,(20,TEMPb0,Tempb1)
hserout 0,(21,VOLTAGEb0,VOLTAGEb1)
hserout 0,(22,CURRENTb0,CURRENTb1)
Here is the code on the 18F2525
Code: Select all
Device = 18F2525
Clock = 40 ' external crystal x 4
#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_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"
// import usart module...
Include "usart.bas"
Dim i As Byte
SetBaudrate(br9600)
ADCON1 = $07 // PORTE as digital (GLCD)
SetAllDigital()
GLCD.Cls
GLCD.SetFont(Fixed)
GLCD.WriteAt(4,2,"RESET")
DelayMS(500)
GLCD.Cls
While true
While USART.DataAvailableTimeout(10)
i = USART.ReadByte()
USART.WriteByte(i) //disply to terminal
GLCD.WriteAt (2,40,DecToStr(i)+ " hello")
Wend
Wend