I have a BUNCH of 16 character messages (25+) that are to be displayed on an LCD. A master sends a command to a receiver (via RF) to light certain LED's, beep a piezo, and display various messages on the two lines of the LCD.
My idea was to have the master send just a code indicating what message each line should display in the receiver, and have the receiver unit read the associated messages from the EEPROM and display it. Since that would involve having another part in each receiver (possibly 40 or more of them), I have since decided that the master will transmit the two lines of the message, so I will only have to use an external EEPROM in the master.
Hopefully, my rambling explains the situation sufficiently...
Andy
Why not store the messages as constant strings in program (FLASH) memory?
Why pay for overpriced toys when you can have
professional grade tools for FREE!!!
I had sorta thought about that..........but I've always wondered how you tell what memory is not going to be used for the program. I always make the code non-relocatable when asked, but how do you..........
Wait a minute, do you just read the chip and look at the hex dump to see what spots are left blank after the program is in it? Is it that simple? Then you just pick an area that isn't being used? Am I on the right track?
That's a great idea! It would certainly lower the serial data overhead - from 39 bytes per transmission to 11. I know, not a lot of data either way, but less chance of errors when the receiver is in a race car!
Thanks
Dave
Always wear safety glasses while programming.
Hi,
Lets say the number of message to be displayed comes in and gets stored in a variable called message.Here the strings are stored in program flash (where else should it go?) and written to the LCD when the LCDOUT statement executes. It's not the most efficient way of doing it but it's probably the easiest. If the messages are partly "the same" (like in the above example) you can have subroutines to print just that part which you then GOSUB from within the Case section, that will save on flash since you don't have to store the same string ("This is message") more than one timeCode:Select Case Message Case 1 LCDOUT $FE, 1, "This is message 1" Case 2 LCDOUT $FE, 1, "This is message 2" Case 3 LCDOUT $FE, 1, "This is message 3" Case Else LCDOUT $FE, 1, "Unknown message" End Select/Henrik.Code:Case 1 GOSUB FirstPart LCDOUT $Fe, 1, "1" ... ... End Select ... FirstPart: LCDOUT $FE, 1, "This is message " RETURN
Love the idea, unfortunately, the messages are ALL different. Some have similar parts, but not similar enough to make that viable.
That's the reason for LOTS of messages.
I decided to store 16 characters for each message (including leading and trailing spaces) because it makes displaying them SO much easier. Each one is a complete line on the LCD, and the loop is the same, no matter if the message is " BLACK FLAG "
or " REPORT TO PIT ". I want each message centered in the display for ease of reading at race speeds.
Ciao!
Andy
Bookmarks