Digole
Digital Solutions
iDigole Buyer ProtectioniDigole Buyer
Protection
My shopping cart
0 Items:
Secure Checkout
Top Rated Plus
Visit Our Live Auctions
99.9% Customer's Satisfaction
 
Forum : Digole Serial Display :

 Search Forum.. 
 Creat New Topic   Reply 

Userfont LCD 320x240

 I want to upload my Userfont on my Display with Version 3.3.

The Controller shows "Data too long"

On my old Display with Version 3.0 it works.

Are there some differents between Version 3.3 and 3.0?

 

 

 
    mydisp.uploadUserFont(3,userfont1,987);
 

RE:Userfont LCD 320x240

 Yes, the V3.3 is a very fine tuned firmware, fixed a lot of bugs(most bugs are not affect by regular usage, but in some special condition), make functions running faster than before, also added some new functions. we are working on the new Arduino lib and release the lib and a new programmer manual soon, please use the following function to instead of old uploadUserFont() function in the firmware is V3.3:

#define V33
 
    void downloadUserFont(int lon, const unsigned char *data, uint8_t sect) {
        uint8_t c;
        unsigned char b;
        Print::print("SUF");
        write(sect);
#if defined(V33)
        write((uint8_t) (lon / 256));
        write((uint8_t) (lon % 256));
#else
        write((uint8_t) (lon % 256));
        write((uint8_t) (lon / 256));
#endif
        b = 0;
        for (int j = 0; j < lon; j++) {
            c = pgm_read_byte_near(data + j);
            write(c);
            if ((++b) == 64) {
                b = 0, delay(40);
            }
        }
    }
 

RE:Userfont LCD 320x240

 What happend with uploadstartscreen, it doesn't work?

RE:Userfont LCD 320x240

 ON V3.3, the start screen use command set to be saved in a specific memory space, more details released soon:

What is command set?

The command set is a command sequence which contain one or more commands and data, that do complicated drawing functions on the screen. Save the command set in the flash chip or MCU flash, run this command set when you needed later, using command set will save you lot of hardware and software resources. A command set must end with a extra byte of value 255.

YES: Only setting and drawing functions (draw Text or graph) can be put in command set. NO: Functions to read data from module and write data to EEPROM and flash can’t be embedded in command set.

CHANGE:

There are different on some drawing function than regular:

Commands : DIM, EDIM1, EDIM2, EDIM3, these 4 command will show a picture on screen, in regular usage, the top-left coordinate will follow the command, then width and height. But when it in command set, the width and height will follow to the command directly, the top-left coordinate is the CGP, that means you need set CGP before these 4 commands in command set, this will give you the ability to display same images at different location on screen.

Command: LT. Line to command accept destination coordinate in regular usage, but it accept the coordinate offset when used in command set.

RE:Userfont LCD 320x240

 Upload Userfont is running. But SetFont() and SetTrueColor() doesn't work. 

RE:Userfont LCD 320x240

 It seems setBackColor() is not working. 

 

{

  Wire.beginTransmission(0x27);

  Wire.write("SC");

  Wire.write(Count);

  Wire.write("BGC");

  Wire.write("SC");

  Wire.write(1);

  Wire.write("SF");

  Wire.write(Font);

  Wire.write("ETP");

  Wire.write(X);

  Wire.write(Y);

  Wire.write("TT");

  Wire.write(Text);

  Wire.write(0x0);

  Wire.endTransmission();  

}

The Background is always blue.

 

RE:Userfont LCD 320x240

 Set background color(BGC)   

Command: BGC, in V3.2 , this command only transfer current foreground color to background, so, you need set a foreground color first, then use “BGC”, the background and foreground have same color now.

In  V3.3, you need specify the one byte value of color (256 color depth,332 format) follow this command. eg.: set a red background: “BGC\xE0” in V3.3 , “SC\xE0BGC” in  V3.2.

 
SetFont() and setTrueColor(); should work.
The internal fonts value are:
 
const unsigned char intfonts[]={0,6,10,18,51,120,123};
 

RE:Userfont LCD 320x240

 The new programmer manual and Arduino lib (beta) released here:

http://www.digole.com/forum.php?topicID=486

RE:Userfont LCD 320x240

 Everything runs.

Now I want upload Startscreen:

 

4,53, // Data Lenght

// Start Picture

68,73,77,10,10, //  DIM + X Y after that I had too insert 255, is that correct?

56,75,0,0,0,0,0,.... // Bytes of the picture

looks like

4,53, // Data Lenght
// Start Picture
68,73,77,10,10,255,56,75,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,

RE:Userfont LCD 320x240

 In V3.3, the extra byte of 255 must be at the end of the command set, that means the last byte in your data must be 255 and this byte not belong to the previous command.

Like this:

4,53, // Data Lenght, you don't need put length here now, just need the length after "SSS" command

// Start Picture

'G','P', 20,10,  //set current position here, it's the x,y for DIM command

68,73,77,10,10, //  DIM + width, height, not DIM +x+y+w+h as usually

56,75,0,0,0,0,0,.... // Bytes of the picture

255  //insert 255 here, indicate the end of command set

RE:Userfont LCD 320x240

 Yes Baby,

it works. I am happy!!!!!

Copyright Digole Digital Solutions, 2008-2017. All rights reserved.
Powered by Victor Sun