BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - LaZorraBRT

Pages: [1] 2
1
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: October 07, 2021, 04:26:26 AM »
Thank you so much Rudolph, I've been trying to get multiple fonts working for a long while and this was the help I needed.

Quote
And when I use FONT_FUN32 for the long text line EVE does not like that very much as the funtype 32 font no longer is cached.
So there are still limits, you can only cache one font and any uncached font needs to be either small enough to allow EVE to fetch all the glyphs in one line from the flash or you need to limit the amount of different glyphs in one line.

I did some experimenting with different size fonts and found that without caching and having a large sized font, it is very limited as to what you can display before you get artifacts / display corruption.

Displaying fonts without caching:
Size 16 - 52 character limit before corruption
size 32 - 26 character limit before corruption
size 64 - 12 character limit before corruption

With caching:
size 16 - tested up to 216 characters without issue
size 32 - tested up to 108 characters without issue
size 64 - 37 character limit before corruption

So caching makes a huge difference!

I tried multiple lines of 9 characters of the 64 pt. font and it displayed ok.  I zipped my code if it is helpful for others. 

2
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: October 05, 2021, 04:36:12 AM »
Or even an example with two or three custom fonts would help me immensely and most likely answer my question.  I've tried multiple configurations to get a second font to work and I am scratching my head.  Thank you!

3
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: October 04, 2021, 02:51:26 AM »
I was able to recreate your code, keeping the same size images for the large numbers and I found a similar empty battery image.  I included my code and tft_data in a zip file below.  The battery now charges and discharges.

Code: [Select]
/* memory-map defines */
#define MEM_FONT 0x000fea00 /* the .xfont file for the UTF-8 font is copied here */
#define MEM_LOGO 0x000fec00 /* start-address of logo, needs 784 bytes of memory */
#define MEM_NUMBERS 0x00000000 /* start-address for 10 number images, ASTC 8x8, 200x384, 19200 / 0x4b00 bytes each */
#define MEM_BATTERY 0x0002ee00 /* start-address for a battery symbol, ASTC 8x8, 176x384, 16896 / 0x4200 bytes */
#define MEM_DL_STATIC (EVE_RAM_G_SIZE - 4096) /* 0xff000 - start-address of the static part of the display-list, upper 4k of gfx-mem */

I understand the memory map for the MEM_NUMBERS, just start it at zero, so first thing in memory.  NUMBERS has a size of 19200 x 10 so 192000.  Therefore MEM_BATTERY gets assigned 0x0002ee00 (192000) which places it directly after NUMBERS in memory.  I hope I am thinking about this correctly.

What I don't understand is where the number for MEM_FONT (1042944) or MEM_LOGO (1043456) come from.  By my logic MEM_FONT could start at 192000 + 16896 or 208896 or at the very least an address shortly after 208896.  Do fonts get a different assignment in memory?  The 512 bytes of space between FONT and LOGO are for the xfont (320 bytes) I am assuming.  Is the glyph data always included before xfont and that's why there is a big jump between the address of MEM_BATTERY and FONT? Then the xfont file knows how to access each glyph?

I'm over the moon that I can make some progress on my project here, thank you so much!

(Please excuse my digit #1, I put it in the middle of the image canvas when resizing things, doesn't line up with the segmented display look)

4
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: October 01, 2021, 10:29:47 PM »
It works for me and looks fantastic, this gives me a lot of hope!

I had to change tft.c to tft.cpp for it to compile, otherwise I got warnings about SPI.  Also I changed your tft.h to:

Code: [Select]
#ifndef TFT_H_
#define TFT_H_

extern uint16_t num_profile_a, num_profile_b;

void TFT_init(void);
void TFT_touch(void);
void TFT_display(void);

#endif /* TFT_H_ */

For some reason, with your tft.h, I was getting "undefined reference" errors on the functions. 

I'm off with the wife to Wisconsin for my mother-in-laws birthday party but I'll see if I can figure out the memory-map defines when I get back.  Looking forward to trying to replicate this with my own fonts and images and hope to have the same amount of success.

Thanks a million Rudolph! 

5
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: September 26, 2021, 10:34:31 PM »
I implemented your suggestion Rudolph:
 
Quote
This line should look like this:
>EVE_cmd_setfont2(12,MEM_FONT50,32);

but it didn't make a difference, the display is still corrupted (split in two).

I'm trying to convert the digits into individual images as a solution but am having difficulty with figuring out how to get the memory-map defines right. 

Code: [Select]
/* memory-map defines */
#define MEM_FONT 0x000f6000
#define MEM_BATTRED 0x000f8000
#define MEM_BATTGREEN 0x000fa000
#define MEM_BATTORANGE 0x000FC000 // 000FC000 = 1032192 which is 8192 more than previous value
#define MEM_NUMONE 0x000FE000
#define MEM_NUMZERO 0x00106000

The three battery indicators are showing up well and also the number one as you can see in the attached photo.  But I cannot figure out how to get the number zero to display (the big purple block in the image).  Is there a limit to how many images one can assign memory-maps?  I figure that these are small images and that I am not running out of memory (I hope).  My code is included in a zip file.  Thank you for any help!

6
Discussion - EVE / Re: Unwanted stripes on the EVE4 1024x600 picture
« on: September 26, 2021, 10:19:04 PM »
Quote
Log:
Detecting flash...

Flash size: 64 MB       .........Wrong should be 128MB
Blob is NOT present.   ..........Last I did was erase.
Flash can NOT switch to full speed.

For what it's worth JuSil, I am having the exact same issue with my EVE4 display and USB2SPI board from MatrixOrbital.  Quite frustrating.

7
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: September 20, 2021, 02:48:01 AM »
I thought that this section of the code, uploaded the data from tft_data into RAM_G:

Code: [Select]
/* this is only needed once to transfer the flash-image to the external flash */
//start of need only once portion
/*
uint32_t datasize;

EVE_cmd_inflate(0, font50, sizeof(font50)); // de-compress flash-image to RAM_G
datasize = EVE_cmd_getptr();  // we unpacked to RAM_G address 0x0000, so the first address after the unpacked data also is the size
EVE_cmd_flashupdate(0,0,4096); // write blob first
EVE_init_flash();
EVE_cmd_flashupdate(0,0,(datasize|4095)+1); // size must be a multiple of 4096, so set the lower 12 bits and add 1
*/
//end of need only once portion

EVE_init_flash();
EVE_cmd_flashread(MEM_FONT50, 167936, 192);
EVE_cmd_setfont2(12,0,32);

initStaticBackground();

I have both the font and the images for the large number within "font50" in tft_data.  Please let me know if I misunderstanding this portion of the code.

Does anyone know if there other examples out there that I can try that have multiple working large images or multiple fonts that are displayed in burst?  I'd love to try any other example that someone has working on a Eve4 display so that I can verify that my display is working correctly.  Thank you for any help!

8
Discussion - EVE / Re: Unwanted stripes on the EVE4 1024x600 picture
« on: September 20, 2021, 02:33:49 AM »
Jusil,
Would you be willing to share the rest of your code? I'd like to try it on the Eve4 display that I have and see how it works. I'm having issues myself coming from a Eve3 to an Eve4.  Thanks!

T

9
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: September 11, 2021, 03:16:03 PM »
Here is the working x=150 and not working x=220.

10
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: September 11, 2021, 03:15:02 PM »
I split the large numbers up into individual images but I am still having graphical glitches (where the top portion of the screen gets duplicated either 2x or x number of times).

For example, this code displays just fine:
Code: [Select]
//Zero
EVE_cmd_setbitmap_burst(0x800000 + 5254, EVE_COMPRESSED_RGBA_ASTC_8x8_KHR, 224, 192); 
EVE_cmd_dl_burst(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_dl_burst(VERTEX2F(150,300));
EVE_cmd_dl_burst(DL_END);

//One
EVE_cmd_setbitmap_burst(0x800000 + 5590, EVE_COMPRESSED_RGBA_ASTC_8x8_KHR, 80, 192); 
EVE_cmd_dl_burst(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_dl_burst(VERTEX2F(480,300));
EVE_cmd_dl_burst(DL_END);


But if I change the x coordinate on the Zero from 150 to 220, such as this, I get the glitch:

Code: [Select]
//Zero
EVE_cmd_setbitmap_burst(0x800000 + 5254, EVE_COMPRESSED_RGBA_ASTC_8x8_KHR, 224, 192); 
EVE_cmd_dl_burst(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_dl_burst(VERTEX2F(220,300));  //x changed from 150 to 220
EVE_cmd_dl_burst(DL_END);

//One
EVE_cmd_setbitmap_burst(0x800000 + 5590, EVE_COMPRESSED_RGBA_ASTC_8x8_KHR, 80, 192); 
EVE_cmd_dl_burst(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_dl_burst(VERTEX2F(480,300));
EVE_cmd_dl_burst(DL_END);

I can play with the coordinates and overlap the numbers on different areas of the screen and it displays fine, so I don't think its an issue with them being overlapped.  Even though in the 2nd bit of code, they shouldn't overlap.  I don't know why moving it to the right 70 pixels should cause the display to go wonky. 

I'll share my complete code and I would love it if someone could try this on their display and at least tell me if this works on another Eve 4. 

I'm really stumped and I'm almost thinking I have a bunk display.   I can upload the same code on my Eve 3 display and it works like a charm.  Not having much luck with Eve 4. 

I tried the fontcache code you shared Rudolph but that resulted in a blank display for me. Thank you, you put a lot of work into your replies and I highly appreciate it. 

Thank you for any help!

11
I would like to second the vote on upping the font size, I know that would be helpful for my project, thank you!

T

12
Discussion - EVE / Re: EVE3 to EVE4 - Big Font Display Issue
« on: August 11, 2021, 02:24:19 PM »
Here are included images of how it looks while it is working on an EVE3 5inch display and also on the EVE4 7inch display with only one large digit. 

13
Discussion - EVE / EVE3 to EVE4 - Big Font Display Issue
« on: August 11, 2021, 02:21:38 PM »
I was previously using a EVE3 5" display and had a large custom font displaying without issue.  When I tried the same code on a EVE4 7" display, I am experiencing a corrupt display.  When I change the code to only display one large digit, it will display correctly.  Also, when I am displaying two digits and they happen to be the same digit, it will display correctly but if they differ it does not work. 

I tried to enable adaptive framerate using the following line under TFT_init but this did not have any effect:
Code: [Select]
EVE_memWrite8(REG_ADAPTIVE_FRAMERATE, 0x1);

I have included my code in a zip file and will include sample images in a following post when this post is approved.  I highly appreciate any help I can get on this issue, thank you!

Todd

This is the part of the code that is causing the display corruption on the 7inch:
Code: [Select]

EVE_cmd_dl_burst(DL_COLOR_RGB | WHITE);
EVE_cmd_dl_burst(DL_BEGIN | EVE_BITMAPS);
EVE_cmd_setbitmap_burst(0x800000 + 5254, EVE_COMPRESSED_RGBA_ASTC_8x8_KHR, 224, 384);
if (speedinttens > 0){
EVE_cmd_dl_burst(CELL(speedinttens));
EVE_cmd_dl_burst(VERTEX2F(50, 100));
}
EVE_cmd_dl_burst(CELL(speedintones));
EVE_cmd_dl_burst(VERTEX2F(290, 100));
EVE_cmd_dl_burst(CELL(speedinttenths));
EVE_cmd_dl_burst(VERTEX2F(530, 100));
EVE_cmd_dl_burst(DL_END);

14
Discussion - EVE / Re: Multiple Buttons Question
« on: August 08, 2021, 07:46:10 PM »
I would not call your code stupid at all, quite the opposite!  Thank you for all your time and effort!

I updated my code based on your help and all is working well now.  I added a third button that just increments the number by one instead of counting up continuously.  Thank you!

Code: [Select]

uint8_t tag;
static uint8_t toggle_lock = 0;
uint16_t toggle_state = 0;
uint16_t toggle_state2 = 0;
uint16_t toggle_state3 = 0;
uint16_t display_list_size = 0;

void TFT_touch(void)
{
    if(EVE_busy()) /* is EVE still processing the last display list? */
    {
        return;
    }

    display_list_size = EVE_memRead16(REG_CMD_DL); /* debug-information, get the size of the last generated display-list */
    tag = EVE_memRead8(REG_TOUCH_TAG); /* read the value for the first touch point */
    uint32_t touchtest = EVE_memRead32(REG_TOUCH_RAW_XY);
   
    switch(tag)
    {
        case 0:
            if(touchtest == 0xffffffff) /* display is no longer touched */
            {
                toggle_lock = 0;
            }
            break;

        case 10: /* use button on top as on/off radio-switch */
            if(toggle_lock == 0)
            {
                toggle_lock = 42;
                if(toggle_state == 0)
                {
                    toggle_state = EVE_OPT_FLAT;
                }
                else
                {
                    toggle_state = 0;
                }
            }
            break;

        case 11: /* use button on top as on/off radio-switch */
            if(toggle_lock == 0)
            {
                toggle_lock = 42;
                if(toggle_state2 == 0)
                {
                    toggle_state2 = EVE_OPT_FLAT ;
                }
                else
                {
                    toggle_state2 = 0;
                }
            }
            break;

case 12: /* use button on top as on/off radio-switch */
            if(toggle_lock == 0)
            {
                toggle_lock = 42;
                if(toggle_state3 == 0)
                {
                    toggle_state3 = EVE_OPT_FLAT ;
                }
                else
                {
                    toggle_state3 = 0;
                }
            }
            break;
    }
}


/*
dynamic portion of display-handling, meant to be called every 20ms or more
*/

int basicnumber = 0;
int basicnumber2 = 0;
int basicnumber3 = 0;

void TFT_display(void)
{

if(tft_active != 0)
{
#if defined (EVE_DMA)
uint16_t cmd_fifo_size;
cmd_fifo_size = EVE_dma_buffer_index*4; /* without DMA there is no way to tell how many bytes are written to the cmd-fifo */
#endif

EVE_start_cmd_burst(); /* start writing to the cmd-fifo as one stream of bytes, only sending the address once */

EVE_cmd_dl_burst(CMD_DLSTART); /* start the display list */
EVE_cmd_dl_burst(DL_CLEAR_RGB | BLACK); /* set the default clear color to white */
EVE_cmd_dl_burst(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG); /* clear the screen - this and the previous prevent artifacts between lists, Attributes are the color, stencil and tag buffers */
EVE_cmd_dl_burst(TAG(0));

EVE_cmd_append_burst(MEM_DL_STATIC, num_dl_static); /* insert static part of display-list from copy in gfx-mem */
/* display a button */
EVE_cmd_dl_burst(DL_COLOR_RGB | GREEN);
EVE_cmd_fgcolor_burst(0x00c0c0c0); /* some grey */
EVE_cmd_dl_burst(TAG(10)); /* assign tag-value '10' to the button that follows */
EVE_cmd_button_burst(50,120,120,70, 28, toggle_state,"Touch!");
EVE_cmd_dl_burst(TAG(0)); /* no touch */

if(toggle_state != 0)
{
basicnumber++;
}

EVE_cmd_dl_burst(DL_COLOR_RGB | RED);
EVE_cmd_fgcolor_burst(0x00c0c0c0); /* some grey */
EVE_cmd_dl_burst(TAG(11)); /* assign tag-value '10' to the button that follows */
EVE_cmd_button_burst(250,120,120,70, 28, toggle_state2,"Touch2!");
EVE_cmd_dl_burst(TAG(0)); /* no touch */

if(toggle_state2 != 0)
{
basicnumber2++;
}

EVE_cmd_dl_burst(DL_COLOR_RGB | PURPLE);
EVE_cmd_fgcolor_burst(0x00c0c0c0); /* some grey */
EVE_cmd_dl_burst(TAG(12)); /* assign tag-value '10' to the button that follows */
EVE_cmd_button_burst(450,120,120,70, 28, toggle_state3,"Touch3!");
EVE_cmd_dl_burst(TAG(0)); /* no touch */

if(toggle_state3 != 0)
{
basicnumber3++;
toggle_state3 = 0;
}

EVE_cmd_dl_burst(DL_COLOR_RGB | GREEN);
EVE_cmd_number_burst(155, 200, 25, EVE_OPT_RIGHTX|5, basicnumber);
EVE_cmd_dl_burst(DL_COLOR_RGB | RED);
EVE_cmd_number_burst(355, 200, 25, EVE_OPT_RIGHTX|5, basicnumber2);
EVE_cmd_dl_burst(DL_COLOR_RGB | PURPLE);
EVE_cmd_number_burst(555, 200, 25, EVE_OPT_RIGHTX|5, basicnumber3);

EVE_cmd_dl_burst(DL_DISPLAY); /* instruct the graphics processor to show the list */
EVE_cmd_dl_burst(CMD_SWAP); /* make this list active */

EVE_end_cmd_burst(); /* stop writing to the cmd-fifo, the cmd-FIFO will be executed automatically after this or when DMA is done */
}
}


15
Discussion - EVE / Re: Multiple Buttons Question
« on: August 04, 2021, 04:34:19 PM »
Yes, the second button will go FLAT when I press it the first time.  However, I cannot press it again and stop the (int basicnumber2 = 0;) from counting up.  The first button works correctly to start and stop the basicnumber++ from counting up.  I thought I could just replicate the code from the first button and have it work but I am scratching my head on this. 

I've cleaned up my code but I am still having the same behavior.  Thank you for responding!

Code: [Select]
uint16_t toggle_state = 0;
uint16_t toggle_state2 = 0;
uint16_t display_list_size = 0;



/* check for touch events and setup vars for TFT_display() */
void TFT_touch(void)
{
uint8_t tag;
static uint8_t toggle_lock = 0;
static uint8_t toggle_lock2 = 0;

if(EVE_busy()) /* is EVE still processing the last display list? */
{
return;
}

display_list_size = EVE_memRead16(REG_CMD_DL); /* debug-information, get the size of the last generated display-list */
tag = EVE_memRead8(REG_TOUCH_TAG); /* read the value for the first touch point */
   
switch(tag)
{
case 0:
        toggle_lock = 0;
      break;

case 10: /* use button on top as on/off radio-switch */
if(toggle_lock == 0)
{
toggle_lock = 42;
if(toggle_state == 0)
{
toggle_state = EVE_OPT_FLAT;
}
else
{
toggle_state = 0;
}
}
break;

case 1:
        toggle_lock2 = 0;
      break;

case 11: /* use button on top as on/off radio-switch */
if(toggle_lock2 == 0)
{
toggle_lock2 = 42;
if(toggle_state2 == 0)
{
toggle_state2 = EVE_OPT_FLAT ;
}
else
{
toggle_state2 = 0;
}
}
break;
}
}



/*
dynamic portion of display-handling, meant to be called every 20ms or more
*/
void TFT_display(void)
{

if(tft_active != 0)
{
#if defined (EVE_DMA)
uint16_t cmd_fifo_size;
cmd_fifo_size = EVE_dma_buffer_index*4; /* without DMA there is no way to tell how many bytes are written to the cmd-fifo */
#endif

EVE_start_cmd_burst(); /* start writing to the cmd-fifo as one stream of bytes, only sending the address once */

EVE_cmd_dl_burst(CMD_DLSTART); /* start the display list */
EVE_cmd_dl_burst(DL_CLEAR_RGB | BLACK); /* set the default clear color to white */
EVE_cmd_dl_burst(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG); /* clear the screen - this and the previous prevent artifacts between lists, Attributes are the color, stencil and tag buffers */
EVE_cmd_dl_burst(TAG(0));

EVE_cmd_append_burst(MEM_DL_STATIC, num_dl_static); /* insert static part of display-list from copy in gfx-mem */
/* display a button */
EVE_cmd_dl_burst(DL_COLOR_RGB | GREEN);
EVE_cmd_fgcolor_burst(0x00c0c0c0); /* some grey */
EVE_cmd_dl_burst(TAG(10)); /* assign tag-value '10' to the button that follows */
EVE_cmd_button_burst(20,120,120,70, 28, toggle_state,"Touch!");
EVE_cmd_dl_burst(TAG(0)); /* no touch */

if(toggle_state != 0)
{
basicnumber++;
}

EVE_cmd_dl_burst(DL_COLOR_RGB | RED);
EVE_cmd_fgcolor_burst(0x00c0c0c0); /* some grey */
EVE_cmd_dl_burst(TAG(11)); /* assign tag-value '10' to the button that follows */
EVE_cmd_button_burst(220,320,120,70, 28, toggle_state2,"Touch2!");
EVE_cmd_dl_burst(TAG(1)); /* no touch */

if(toggle_state2 != 0)
{
basicnumber2++;
}

EVE_cmd_dl_burst(DL_COLOR_RGB | PURPLE);
EVE_cmd_number_burst(120, EVE_VSIZE - 35, 26, EVE_OPT_RIGHTX|5, basicnumber);
EVE_cmd_number_burst(120, EVE_VSIZE - 20, 26, EVE_OPT_RIGHTX|5, basicnumber2);

EVE_cmd_dl_burst(DL_DISPLAY); /* instruct the graphics processor to show the list */
EVE_cmd_dl_burst(CMD_SWAP); /* make this list active */

EVE_end_cmd_burst(); /* stop writing to the cmd-fifo, the cmd-FIFO will be executed automatically after this or when DMA is done */
}
}


Pages: [1] 2