Help .. convert to characters

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

xva3rjy
Posts: 40
Joined: Sat Sep 27, 2014 11:41 am

Re: Help .. convert to characters

Post by xva3rjy » Thu Oct 16, 2014 10:59 am

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
Attachments
GLCD4.JPG
GLCD4.JPG (46.68 KiB) Viewed 2769 times

xva3rjy
Posts: 40
Joined: Sat Sep 27, 2014 11:41 am

Re: Help .. convert to characters

Post by xva3rjy » Thu Oct 16, 2014 10:59 am

also set max lines to 5

Jerry Messina
Swordfish Developer
Posts: 1237
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Help .. convert to characters

Post by Jerry Messina » Thu Oct 16, 2014 11:07 am

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).

Jerry Messina
Swordfish Developer
Posts: 1237
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Help .. convert to characters

Post by Jerry Messina » Thu Oct 16, 2014 11:22 am

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'

xva3rjy
Posts: 40
Joined: Sat Sep 27, 2014 11:41 am

Re: Help .. convert to characters

Post by xva3rjy » Thu Oct 16, 2014 8:07 pm

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
Attachments
GLCD6.JPG
GLCD6.JPG (27.06 KiB) Viewed 2755 times
GLCD5.JPG
GLCD5.JPG (32.65 KiB) Viewed 2755 times

Jerry Messina
Swordfish Developer
Posts: 1237
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Help .. convert to characters

Post by Jerry Messina » Fri Oct 17, 2014 12:58 pm

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.

bitfogav
Registered User
Registered User
Posts: 166
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: Help .. convert to characters

Post by bitfogav » Fri Oct 17, 2014 1:06 pm

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.

Post Reply