Page 3 of 3

Re: Help .. convert to characters

Posted: Thu Oct 16, 2014 10:59 am
by xva3rjy
Confirmed PICAXE code regarding baud and mode setup
symbol Baud_Setup = B19200_64
symbol Mode = %00000000 'Mode: No background receive, no serial data invert.

Latest baudrate on GLCD
USART.SetBaudrate(br19200)

Photo with result attached

Re: Help .. convert to characters

Posted: Thu Oct 16, 2014 10:59 am
by xva3rjy
also set max lines to 5

Re: Help .. convert to characters

Posted: Thu Oct 16, 2014 11:07 am
by Jerry Messina
The only time he got printable characters to the GLCD was when you added HexToStr. the other times
it was just the raw data which makes me think that the baud is incorrect
You could well be right that the baudrates aren't being set to match, but just to be clear:

EVERY message sent from the picaxe contains some raw binary unprintable data, so in almost every case you have to use one of the convert functions to turn the data into an ASCII string. The exception are the message numbers 23-26 which send two ASCII characters, but even these send one byte of binary data first (the number 23-26).

Re: Help .. convert to characters

Posted: Thu Oct 16, 2014 11:22 am
by Jerry Messina
You're likely getting framing errors.

I see

Code: Select all

Device = 18F2525
Clock =   40                              '  external crystal x 4

//Config OSC = HSPLL                       '   Config OSC = HSPLL
If you have an external 10MHz xtal you need to uncomment that config OSC=HSPLL, or set 'clock = 10'

Re: Help .. convert to characters

Posted: Thu Oct 16, 2014 8:07 pm
by xva3rjy
Great news it works! Thanks very much for help. I don't recall why I had 40 instead of 10.
I can now start some meaningfully programming. BTW this is my first programming project ever.

On another note see my photos.
I put the following into to code to see that I can utilize the full real estate.

Code: Select all

GLCD.WriteAt(5,5,"RESET 5 5")
GLCD.WriteAt(100,5,"RESET 100 5")
GLCD.WriteAt(5,100,"RESET 5 100")
GLCD.WriteAt(100,100,"RESET 100 100")
However after that I can write to the 3rd CS3 area. I am using the moded ks0108 code to enable CS3

Code: Select all

#option GLCD_SIDE_SIZE = 64      // Screen Block (side) size. For Some screens = 60 (check your datasheet).
#option GLCD_SCREEN_WIDTH = 192  // Screen Width in Pixels
#option GLCD_SCREEN_HEIGHT = 64  // Screen Height in Pixels
#option GLCD_CS_COUNT = 3    // Count of CS Lines. Must be 2 or 3

Re: Help .. convert to characters

Posted: Fri Oct 17, 2014 12:58 pm
by Jerry Messina
BTW this is my first programming project ever
Congratulations! Not bad for a first time attempt.

If I might make a suggestion - next time try and include as much info as possible.

The stuff Coccoliso and bitfogav were able to dig up really helped. Once we got the formatting out of the way, bitfogav was right... it WAS a baudrate issue, just not an obvious one.

Re: Help .. convert to characters

Posted: Fri Oct 17, 2014 1:06 pm
by bitfogav
Yeah great news! :)

It would be nice to see your final build for this project!, And thanks to Jerry too for the initial code he posted a few posts ago, that helped see the problem.