steved
Junior Member
Posts: 13
|
Post by steved on Apr 19, 2021 12:30:13 GMT -8
Hello, I have two images I am trying to load from a micro SD card. I was able to get one of them to work using Gimp and saving it as non-progressive and 4:2:0, but the other image still always causes my display to show "COPROCESSOR EXCEPTION". Is there something else I need to do to the image to get it to work? Image: 400x240 backgroundArduino Uno Display is Newhaven NHD-5.0 displaywith the NHD-081x shield Arduino shield#include <EEPROM.h>
#include <SPI.h>
#include <GD2.h>
void setup()
{
GD.begin();
GD.cmd_loadimage(0, 0);
GD.load("background2.jpg");
}
void loop()
{
GD.Clear();
GD.Begin(BITMAPS);
GD.Vertex2ii(0, 0);
GD.swap();
}
|
|
|
Post by tftlcdcyg on Apr 19, 2021 19:53:40 GMT -8
Format your microSD in Fat32 system. Sometimes that fixes that error
|
|
steved
Junior Member
Posts: 13
|
Post by steved on Apr 20, 2021 6:46:54 GMT -8
I formatted this morning to no avail. I've tried indexed color, not optimizing, turning progressive off, setting the ratio to 4:2:0. Nothing seems to work. Can anyone help?
|
|
|
Post by tftlcdcyg on Apr 21, 2021 18:53:27 GMT -8
Could you indicate the microSD card model you are using?
The library for gameduino has a limit. It is possible to use microSD memories of more than 64 Gb, but you have to make some adjustments to the library so that it can be used with the latest version of the SdFat library. I have been working on a version of the library for gameduino that can work on boards like the teensy 4 or 4.1 and its SDIO reader, with memories formatted in Fat32 or exFat. The latest version can work with 128 Gb microSD memories.
That NHD-5 "screen has an FT813 chip, I think you should correct the screen timmings so that it can work without problems with the library:
GD.wr32 (REG_HCYCLE, 1056); GD.wr32 (REG_HOFFSET, 88); GD.wr32 (REG_HSIZE, 800); GD.wr32 (REG_HSYNC0, 0); GD.wr32 (REG_HSYNC1, 10); GD.wr32 (REG_VCYCLE, 525); GD.wr32 (REG_VOFFSET, 32); GD.wr32 (REG_VSIZE, 480); GD.wr32 (REG_VSYNC0, 0); GD.wr32 (REG_VSYNC1, 10); GD.wr32 (REG_PCLK, 2); GD.wr32 (REG_PCLK_POL, 0); GD.wr32 (REG_CSPREAD, 0); GD.wr32 (REG_DITHER, 1);
|
|
steved
Junior Member
Posts: 13
|
Post by steved on Apr 21, 2021 21:14:38 GMT -8
I don't know the make, but it's only a 16 GB microSD. I used this from Newhaven Displays to change the GD2.cpp to use the different size screen. I have a working application now. I used the asset convertor to get all the graphics, but because of the 256k limit I had to cut out using a custom background. It would be nice to know why one image seemed to work, but another did not.
|
|