Uploading a bitmap programmatically on a GLK240128-25

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
oneelkruns
LCD?
Posts: 5
Joined: Fri Aug 31, 2007 6:34 am

Uploading a bitmap programmatically on a GLK240128-25

Post by oneelkruns »

I'm trying to write code to upload a bitmap file to a GLK240128-25 and the board does not seem to be responding as the manual would have you believe it should. For test purposes I'm using Python under Linux. Here's what I'm seeing:

If I upload a bitmap using MOGD# the board displays it for me when it powers up (refID 1). From Python, if I send a delete command (0xFE, 0xAD, 0x01, 0x01) the bitmap is deleted. I know communication between the board and Python is working perfectly.

If I then issue the commands to start uploading a new bitmap file: 0xFE, 0x5E, 0x01 (using refID 0x01 which I know is available because I just deleted the file) I get one of two replies. The first time I send the sequence I get nothing back. The manual seems to say I should get 0x01 back to indicate that the reference ID is available. If I send the same sequence a second time I get 0x08 back, the decline byte.

Does anyone have an idea why this is happening? Is there a simple code example somewhere of the sequence for uploading a file?

Any help appreciated!

Ron

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hi Ron,

Let me first congratulate you on the successful creation of an adverb for 'by programming means', I may start using that. As for your question, you are right, the uploading pseudo code in the manual is not quite correct. I will soon be working to correct it, but for now I have included the correct algorithm for a bitmap file upload below.

Host: Transmit(0xFE); //Command Prefix
Transmit(0x5E); //Bitmap file upload command
Transmit(0x05); //Reference ID for bitmap file
Transmit(0x19); //Transmit bitmap file size LSB
Transmit(0x00); //Transmit bitmap file size MSB

Module: FileFits(0x01); //Send confirmation that file fits

Host: Receive(); //Receive confirmation that file fits
Transmit(0x05); //Transmit first byte of file data

Module: Echo(0x05); //Echo first byte of file

Host: Receive(); //Receive echo
Confirm(0x05); //Confirm echo
Transmit(0x07); //Transmit second byte of file data

etc...

If any byte other than 0x01 is seen for confirmation by host or module (usually 0x08) the upload it aborted.

That should work a little better for you, let me know how it turns out,

Troy
Troy Clark
Design & Development
Matrix Orbital

oneelkruns
LCD?
Posts: 5
Joined: Fri Aug 31, 2007 6:34 am

Post by oneelkruns »

Clark-

Regarding "by programming means", what can I say? That's what happens when I work on this stuff so early in the morning.

I'm sure the protocol you posted will help considerably, thank you!

Ron

Post Reply