So I hope to get some guidance on the best way to program both my Arduino and the C++ computer program. The general premise it that i would like to be able to send 256 color images to a small LCD over a serial without the use of flash memory on the Arduino.
PC with image to send --> (Serial) --> Arduino --> (SPI) --> LCD
I am using this LCD:
Programming Manual:
Which really only takes the following command:
void drawBitmap256(uint8_t x, uint8_t y, uint8_t w, uint8_t h, const uint8_t *bitmap);
The following 4 bytes are start positon: x, y, image
width, height, then following image data, each byte
represent one pixel
So. Can anyway with experience tell me if its possible just to point the command to the serial bus to read directly? The biggest problem i see with this is I am relying on the serial buffer which as we know is very small so i might lose data.
The last option which I may just do is multiplex the images. So i send each image in sets of 16x16 or something.
Am I correct to think that a complete image requires 96 x 64 x 1 bytes = 6144.
It would be wise to assume an Uno (with 2k of SRAM) could only store 512 bytes of this at any one time, though you may be able to squeeze in some more if the rest of your program has very little to do.
A Mega has 8k so it should be able to store a complete image.
Without reading the data sheet I don't know if it is possible to send an image to the LCD in, say, 12 parts (6144 / 12)
Yes, Robin I think I may just have to store the image in sections. The images I am using are 64x64 windows icons. Which is still 64641=4096 bytes of data. Since we are working with 2056 bytes of RAM maybe splitting the image into quarters 32321=1024 bytes each would be better. I still need room for at least two dozen other int values so I don't want to run out of room. (no strings or lookup tables)
I wish I was working with a mega but I have an UNO SMD and cant put more money into this project.
I would write a test program that just uploads a single 512 byte piece of image and get that working with all of the rest of your code before I extended it to multiple 512 byte chunks or 1024 byte chunks. That way you will be easier able to see what is causing a problem.
Running out of SRAM can cause difficult-to-debug problems.
You didn't answer my question about how often the image changes.
Oh Sorry Robin.
The image changes maybe once every 30 minutes. It really depends on the user. Ill explain.
The project will have (probably) 4 LCD screens (SPI interface) that will display the icons of any program making noise on the connected PC. So if you have Skype, iTunes, and League of Legends open those will all be displayed on the LCD's.
So speed is not much of an issue. I don't need 30 frames per second. I would be happy with 1fps. I am just trying to do this as simply as possible.