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
Uploading a bitmap programmatically on a GLK240128-25
-
- LCD?
- Posts: 5
- Joined: Fri Aug 31, 2007 6:34 am
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
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
Design & Development
Matrix Orbital
-
- LCD?
- Posts: 5
- Joined: Fri Aug 31, 2007 6:34 am