PDA

View Full Version : LCD Appmod - Custom Character not working



Jbyrd23
05-15-2006, 09:38 AM
Hey Everyone!
First time poster. I recently received the LCD AppMod and have been working on understanding how to program it. I have been looking through the LCDAppModDemo program and creating some basic programs to work through all of the different options. I think I am understanding the basics, but I'm getting stuck on displaying a custom character.
The code is attached. When it tries to display the smiley face, it just displays what I guess is a null character.

From the LCDAppModDemo it has:

Msg2 DATA " BASIC STAMP ", 3, " ", 0

Where it references the smiley face is where the 3 is. I am not understanding how 3 references it-- that may be where I am getting stuck.
I could also have the "For Idx" in the "Download Char" section setup incorrectly, as I am trying to convert that to just one character and in the Demo it is setting up four.
I added some comments to the code as to how I am understanding it. If anyone can shed some light on this, or point out if I am misunderstanding anything, I'd greatly appreciate it.

Jon Williams
05-15-2006, 10:17 AM
The Smiley character is defined as character number 3. Characters 0 - 2 define the Pacman-like munching mouth. What's important to remember is that the LCD you send character codes to the LCD for display, and characters 0 - 7 are the custom characters.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Jbyrd23
05-15-2006, 10:50 AM
Thanks for the response, Jon!

I thought it might work that way, and had tried 0 as the reference, but that displayed nothing at all. I did try a few things and figured it was in how I had setup the FOR IDX line in the Download Charcters section.

I added a CC0 charcter and changed the FOR IDX from:

FOR idx = Smiley TO (Smiley + 7)

to

FOR idx = CC0 TO (Smiley + 7)

After that, the reference "1" for the character worked. How would I need to setup the Download Char section for just one custom character? I tried a few things with that earlier, but nothing seemed to work. I appreciate any help or direction you can provide. I have been reading all I could find on this in the LCD Documentation, Nuts & Volts downloads, and Stampworks pdf, but all the examples are for multiple characters.

Jon Williams
05-15-2006, 11:04 AM
Point to the location in CGRAM for the character data, then download a map of eight bytes.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Jbyrd23
05-15-2006, 12:27 PM
I was able to get my program to do what I wanted, though it probably wasn't the best solution.

I guess I should have prefaced my message by saying that I haven't had any formal electronics training, or (yet) had any programming training-- (going back to school for SE, but not at those classes yet). I am approaching this from a standpoint of looking at the programming provided in the examples of the BOE-Bot Documentation, and the LCDAppModDemo, and trying to make sense of them. I feel I am understanding the process for most of it, but this one just got me stuck.. I guess I am jumping ahead, or missing something in the reading I have done.
I was able to bypass the issue in the code I provided and in the main program I am working on by adding an unused custom character for the 0 (CGRAM?) reference. I guess I don't understand the process enough to make it display that first custom character. The programs work fine by referencing the 1, or 2 position custom character in the display messages; when I reference the 0 char for a message, it does nothing.
I don't mean to be a nuisance with my noobishness. Thanks for your help!

Jon Williams
05-15-2006, 06:39 PM
Well, what we do here is embedded programming, with elecronic circuits attached to the BASIC Stamp. Luckily, Parallax has a lot of good information and you can vey quickly shed that "newbie" label by reading and working through "What's A Microcontroller?" Looking at examples is one thing; actually understanding them is another.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Jbyrd23
05-16-2006, 06:02 AM
I went through the BOE-Bot book and I felt that I understood that pretty well, but·I haven't gone through the "What's a Microcontroller"·book.· I'll do that to make sure I have the basics·covered.· Thanks for your time, Jon!

Jon Williams
05-16-2006, 06:03 AM
You're welcome; and WAM will be worth the effort you spend on it -- will set you up nicely for many years of fun to come.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax