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

Main Menu
Menu

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.

Show posts Menu

Messages - vdc

#1
The best way is do the checksum. Copy 1MB from Flash to RAM_G and get the CRC32. repeat this depending on the size of the flash memory you use. This will ensure you have correct flash images every time you boot.

ex: I only use 3MB of external flash to store all the assets I need. Everytime I boot up, I only do the CRC of first 3MB. Ignore the rest. This should be quick.
#2
Discussion - EVE / PC Emulator
August 02, 2024, 10:36:28 PM
Hi,

Is there a guide available for using bt8xxemu.dll? I am looking to build a PC emulator using Visual Studio with C/C#. My goal is to create a GUI emulator on a PC with two windows: one for the EVE Emulator Display and another that allows configuration changes to the EVE Emulator Display by sending all command APIs. I want to be able to reuse the code on an MCU. Unfortunately, "EVE Screen Designer" is not an option for me as I find it quite confusing. A guide specifically for using Visual Studio with C/C# would be really helpful.

Best regards,
#3
I'm using Riverdi EVE4 Display (RVT70HSBNWC00-B)

I just do a quick test, sending all command to command FIFO take 1ms. Including copy Bitmap to flash total time will be 14ms (fixed some problem with my code)


My define to calculate FPS

#define DispHCycle    1344L
#define DispVCycle    635L
#define DispPLCLKFREQ  0x8C1       
Gpu_Hal_Wr8(host, REG_PCLK, 2);

So based on Fps = (System Clock/REG_PCLK) / (VCYCL * HCYCLE)
(72000000/2) / (1344 * 635) ~= 42FPS

Also, for the touch interrupt, how do we make sure touch interrupt not corrupt display function?

For example. My Display() take about 24ms to finished is worst case for waiting copy stuff from flash to RAM_G. If the interrupt kick in before the Display() finished. A command from display may corrupted. How we fix this problem?

Also, when touch detected, interrupt kick in. If the interrupt kick in during Display() function sending data to Command FIFIO. In most case, there will be a command corrupted because the CS line reset. From the interrupt, I can signal the Touch function to scan after Display() finished. But there can be chance when Touch scan, touch already released cause the TAG/XY is empty, scan will be no touch because we share the same SPI bus from MCU to EVE4. Unless we can read the Touch signal on difference bus (UART/I2C) directly from MCU.


#4
Quote from: BRT Community on April 03, 2024, 09:51:09 AM
Hello,

Are you performing the flash to RAM_G write for every instance of the display being issued in relation to the RGB565 image?


Best Regards,
BRT Community


Not really, here is my code display 371x400 bitmap on screen.


   

Display(){
static uint8_t Close = 0;

Gpu_CoCmd_Dlstart(phost);
App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(255, 255, 255));
App_WrCoCmd_Buffer(phost,CLEAR(1,1,1));

App_WrCoCmd_Buffer(phost, COLOR_RGB(0xFF,0xFF,0xFF));
App_WrCoCmd_Buffer(phost, COLOR_RGB(0, 81, 122));
Gpu_CoCmd_Text(phost, 512, 62, 31, OPT_CENTER, "DOOR IMAGES");

// Load one time
if(Load == 0){
Gpu_CoCmd_FlashRead(phost, DOOR_RAM_G, DOOR_ADDRESS, DOOR_SIZE);
Load = 1;
}

// Draw Bitmap
Gpu_CoCmd_SetBitmap(phost, DOOR_RAM_G, RGB565, DOOR_CLOSING_W, DOOR_CLOSING_H);
App_WrCoCmd_Buffer(phost, COLOR_RGB(0xFF,0xFF,0xFF));
App_WrCoCmd_Buffer(phost, BEGIN(BITMAPS));
App_WrCoCmd_Buffer(phost, VERTEX2F(320*16, 125*16));
App_WrCoCmd_Buffer(phost, END());

// Draw Buttons
Gpu_CoCmd_FgColor(phost, 0x00557F);
App_WrCoCmd_Buffer(phost, COLOR_RGB(0xFF,0xFF,0xFF));
App_WrCoCmd_Buffer(phost,TAG_MASK(1)); // Enable Tagging

App_WrCoCmd_Buffer(phost, TAG(KEY_TAG_1));
Gpu_CoCmd_Button(phost, 710, 540, 90, 50, 29, 0, "1");

App_WrCoCmd_Buffer(phost, TAG(KEY_TAG_2));
Gpu_CoCmd_Button(phost, 810, 540, 90, 50, 29, 0, "2");

App_WrCoCmd_Buffer(phost, TAG(KEY_TAG_3));
Gpu_CoCmd_Button(phost, 909, 540, 90, 50, 29, 0, "3");

App_WrCoCmd_Buffer(phost,TAG_MASK(0)); // Disable Tagging

App_WrCoCmd_Buffer(phost, DISPLAY());
Gpu_CoCmd_Swap(phost);
App_Flush_Co_Buffer(phost);
Gpu_Hal_WaitCmdfifo_empty(phost);
}



The first time is worst case where it take more time because it need time to load Bitmap from flash to RAM_G. This take about 45ms to display on screen.
After that, the display take about 29ms.

Because in normal case, the display function already take about 29ms. Scanning Touch Screen within 50ms doesn't make sense to me because at some point, the display haven't finished yet. Is this because high resolution cause the problem?

#5
Have anyone test with EVE4 1024x600 resolution display?

Current, I'm having Tiva with SPI at 16Mhz. What my display doing is load bitmap RGB565 (371x400) from flash to RAM_G, with 3 buttons. The total time it takes about 45ms. I'm not sure why it take that long to display one screen. The worst case can be more.

By that, I only can scan key every 100ms. My code doing is having a flag at 100ms. when flag is set, it scan and display. I can't find any better way to handle display and touch function.

I do feel like the cmd list I send from MCU to EVE4 is fast but the time for EVE4 display on screen is take so long that I can't do same as @Rudolph that scan key for every 5ms and display every 20ms.

I haven't try to use DMA or QSPI yet, but my setup is really simple and it take that long to display so I'm not sure using DMA/SQPI will improve the display time or not.
#6
Discussion - EVE / Re: Simple way to draw meter
February 22, 2023, 01:34:21 AM
Thank you so much. This help me alot.
#7
Discussion - EVE / Re: Simple way to draw meter
February 20, 2023, 01:13:04 AM
Something like the attached image.
#8
Discussion - EVE / Simple way to draw meter
February 03, 2023, 04:25:24 PM
Hi all,

Is there any simple way to draw a meter? I look at the DemoMeterDemo application and try to understand but this give me a really hard time to follow the code.

I tried with drawing two circle to get the  meter circle. But I have no idea how to get color changed when moving let say arrow.

Let say at 50%, the first half circle is green and the other half is red. I tried with the EDGE_STRIP but it just cover all the other half. Is there any better way to display this?

Thank you so much,

QuoteSCISSOR_XY(300,780)
SCISSOR_SIZE(200,120)
CLEAR_COLOR_RGB(0xff,0xff,0xff)
CLEAR(1, 1, 1)
POINT_SIZE(1600)
BEGIN(POINTS)
VERTEX2F(6400, 14400)
COLOR_RGB(0xFF,0xFF,0xFF)
POINT_SIZE(800)
VERTEX2F(6400, 14400)
END()



#9
Hi David,

How do you read each letter in xFont file? You display a single character at one and read from RAM_G to get the width and manually calculate all at time? I confuse the psesudo code from the programming guide.
#10
Where I can get support this?
#11
Discussion - EVE / Calculate String Width in Custom Font
December 16, 2022, 02:47:49 AM
Hi,

I'm using 1024 x 600 7" display and using NotoSansCJK custom font with size 37

QuoteFont Conversion completed!

Generated Folder: NotoSansCJK-Regular_37_Extend
Format:           COMPRESSED_RGBA_ASTC_8x6_KHR
Compressed:       thorough
Layout Width:     80
Layout Height:    8
Pixel Width:      40
Pixel Height:     48
Number of characters in xfont file:      65408
Number of characters in user input file: 354
   Success: 349
   Fail:    5
   Fail code point: 0x5f00, 0x8a00, 0x9000, 0x9700, 0x9600
There are non-graphic characters filtered out.
NotoSansCJK-Regular_37_ASTC.xfont and NotoSansCJK-Regular_37_ASTC.glyph are generated successfully.

----------------------------------------------------------------------

json file
Quote
{"name": "NotoSansCJK-Regular_37_ASTC", "type": "extendedfont", "astc_block_footprints": "8x6", "size": 37, "base_line": 33, "caps_height": 28, "mid_line": 20, "x_width": 21, "x_offset": 0, "address_type": "FLASH", "address_glyph": 3925440}

I try to calculate the width of the string from the command

QuoteGpu_CoCmd_Text(phost, 512, 20, FONT_M_HANDLE, OPT_CENTERX, "CONNECT FLUID BAGS, UNCLAMP LINES");

From the information above

"CONNECT FLUID BAGS, UNCLAMP LINES" = 33 characters and based on the converted log pixel width is 40.

33 * 40 = 1320 pixel. This seem not right for me because the display width is 1024 pixels. I'm not sure how the EAB convert the font size and the width for each character.

My goal is try to highlight and change the color of a word in a string (see the attachment) when a flag is set.

If I can get the correct string width in pixels then I can figure out the x/y position of each character so I can draw rects box and change text color dynamically.

Is there any command to get the true width size of a text string or can we set custom font have the same width for each character?


#12
Discussion - EVE / Re: ASTC Custom Font from Flash
December 08, 2022, 02:33:18 PM
yeah, remove font cache every screen help alot too. No more flickering. I will keep update if there are any problem.

Thank you so much.
#13
Discussion - EVE / Re: ASTC Custom Font from Flash
December 01, 2022, 03:34:57 PM
Hi Rudolph,

Here is my sample code

Quoteint main(void)
{
   BT81X_Setup();
   
   while(1){
      uint32_t totalBefore;
      uint32_t totalAfter;
      int32_t usedBefore;
      int32_t usedAfter;


      // Screen PreCode
      Gpu_CoCmd_Dlstart(phost);
      App_WrCoCmd_Buffer(phost, CLEAR_COLOR_RGB(0, 0, 0));
      App_WrCoCmd_Buffer(phost,CLEAR(1,1,1));

      // Start
      // Set Font Handle
      //Gpu_CoCmd_SetFont2(phost, FONT_S_HANDLE, RAM_G + 1000000, 0);
      Gpu_CoCmd_SetFont2(phost, FONT_M_HANDLE, RAM_G + 1000000, 0);
      Gpu_CoCmd_FontCache(phost, FONT_M_HANDLE, 0xC000, 512000);
      App_Flush_Co_Buffer(phost);

      Gpu_CoCmd_SetBitmap(phost, RAM_G + 1000000, COMPRESSED_RGBA_ASTC_8x8_KHR, 40, 64);

      Gpu_CoCmd_FontCacheQuery(phost, &totalBefore, &usedBefore);
      UARTprintf("totalBefore: %d, usedBefore: %d\r\n", totalBefore, usedBefore);


      App_WrCoCmd_Buffer(phost, COLOR_RGB(0xFF,0xCA,0x18));

      Gpu_CoCmd_Text(phost, 30, 133/2, FONT_M_HANDLE, OPT_CENTERY, "设置流速");
      Gpu_CoCmd_Text(phost, 230, 133/2, FONT_M_HANDLE, OPT_CENTERY, "= 10 ml/min");

      Gpu_CoCmd_Text(phost, 30, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "实é™...流速");
      Gpu_CoCmd_Text(phost, 230, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "= 10 ml/min");

      Gpu_CoCmd_Text(phost, 30, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "è¾"注量");
      Gpu_CoCmd_Text(phost, 230, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "= 0 ml");

      Gpu_CoCmd_Text(phost, 550, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "T = 33.8 °C");
      Gpu_CoCmd_Text(phost, 550, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "P = 130 mmHg");

      //Gpu_CoCmd_FillWidth(phost, 50);
      Gpu_CoCmd_Text(phost, 50, 400, FONT_M_HANDLE, OPT_CENTERY, "重新启动系统");

      Gpu_CoCmd_Text(phost, 50, 450, FONT_M_HANDLE, OPT_CENTERY, "更换新çš,,一次");

      Gpu_CoCmd_Text(phost, 50, 500, FONT_M_HANDLE, OPT_CENTERY, "性使ç"¨è¾"血通ç"¨ç®¡è·¯");
      // End

      Gpu_CoCmd_FontCacheQuery(phost, &totalAfter, &usedAfter);
      UARTprintf("totalAfter: %d, usedAfter: %d\r\n\r\n", totalAfter, usedAfter);

      // Screen PostCode
      App_WrCoCmd_Buffer(phost, DISPLAY());
      Gpu_CoCmd_Swap(phost);
      App_Flush_Co_Buffer(phost); //Download the commands into fifo
      while(EVE_busy()); // Gpu_Hal_WaitCmdfifo_empty(phost); //Wait till coprocessor completes the operation
      
      delay_ms(100);
   }
   
}


And print out:

QuotetotalBefore: 789, usedBefore: 0
totalAfter: 789, usedAfter: 45

I changed the size in fontcache to difference value like 256000 (394 total) or 128000 (197 in total). I also try the delay_ms up to 1000ms. The screen still flickering but not much as 100ms/10ms delay time.

My application requires update at least one every 1 second (for RTC) and update when display variable changed like 10 ml/min to 11ml/min or more...

Do I need to change the display setup and how to know I'm setup correctly?

Best regards,

#14
Discussion - EVE / Re: ASTC Custom Font from Flash
November 30, 2022, 03:32:53 PM
Yes, I based on the datasheet from Riverdi for display setting.

The flicker only happen if I display more Custom Font Characters. If I only display like 20 characters then it works fine. However, when I try to run more. The flicker happen.

If only these line, then it works fine.
QuoteGpu_CoCmd_Text(phost, 30, 133/2, FONT_M_HANDLE, OPT_CENTERY, "设置流速");
    Gpu_CoCmd_Text(phost, 230, 133/2, FONT_M_HANDLE, OPT_CENTERY, "= 10 ml/min");



    Gpu_CoCmd_Text(phost, 30, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "实é™...流速");
    Gpu_CoCmd_Text(phost, 230, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "= 10 ml/min");

When I add more, then flicker happens

QuoteGpu_CoCmd_Text(phost, 30, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "è¾"注量");
    Gpu_CoCmd_Text(phost, 230, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "= 0 ml");



    Gpu_CoCmd_Text(phost, 550, 133/2 + 133, FONT_M_HANDLE, OPT_CENTERY, "T = 33.8 °C");

    Gpu_CoCmd_Text(phost, 550, 133/2 + 266, FONT_M_HANDLE, OPT_CENTERY, "P = 130 mmHg");


    //Gpu_CoCmd_FillWidth(phost, 50);
    Gpu_CoCmd_Text(phost, 50, 400, FONT_M_HANDLE, OPT_CENTERY, "重新启动系统");

    Gpu_CoCmd_Text(phost, 50, 450, FONT_M_HANDLE, OPT_CENTERY, "更换新çš,,一次");

    Gpu_CoCmd_Text(phost, 50, 500, FONT_M_HANDLE, OPT_CENTERY, "性使ç"¨è¾"血通ç"¨ç®¡è·¯");
    // End

This is just example.
#15
Discussion - EVE / Re: ASTC Custom Font from Flash
November 29, 2022, 06:20:46 PM
After using FontCache, I was able to display more custom chinese font, but the problem is the display keep flickering.

QuoteFont Conversion completed!

Generated Folder: FZShuSong_36_Extend
Format:           COMPRESSED_RGBA_ASTC_8x8_KHR
Compressed:       thorough
Layout Width:     80
Layout Height:    8
Pixel Width:      40
Pixel Height:     64
Number of characters in xfont file:      65408
Number of characters in user input file: 292
   Success: 287
   Fail:    5
   Fail code point: 0x5f00, 0x8a00, 0x9600, 0x9000, 0x9700
There are non-graphic characters filtered out.
FZShuSong_36_ASTC.xfont and FZShuSong_36_ASTC.glyph are generated successfully.

----------------------------------------------------------------------

    Gpu_CoCmd_SetFont2(phost, FONT_M_HANDLE, RAM_G + 1000000, 0);
    Gpu_CoCmd_FontCache(phost, FONT_M_HANDLE, 0xC000, 512000);

40*60*2 = 5120
5120 * 100 ( chars) = 512000 bytes (the value I use in FontCache command). 0xC000 is address in RAM_G ?

Gpu_Hal_Wr16(host, REG_AH_HCYCLE_MAX, DispHCycle + 700); is in the setup.

Display now can show more chinese characters but the screen keep flickering. Any suggestion?