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.

Topics - dpardo

Pages: [1]
1
Discussion - EVE / Loading Image into RAM_G Example
« on: July 29, 2022, 02:30:04 PM »
Hello,

I'm currently trying to write an image to RAM_G and display it on a display using BT817.  I've converted the png to and EVE bitmap and then a C array using EAB, but I think I'm missing something when loading it into RAM_G.

Code: [Select]
void write_ram_g(uint32_t image_size)
{
printf("Writing to RAM_G... ");
cmd_loadimage(RAM_G, OPT_FULLSCREEN);
for (int i = 0; i < image_size; i += 4)
{
uint32_t write_data = (flash_image[i+3] >> 24) | (flash_image[i+2] >> 16) | (flash_image[i+1] >> 8) | flash_image[i];
Send_CMD(write_data);
}
UpdateFIFO();
Wait4CoProFIFOEmpty();
printf("complete\n");
}

void verify_ram(uint32_t image_size)
{
for (int i = 0; i < image_size; i++)
{
printf("%d\n", rd8(RAM_G + i));
}
}


void screen_logo()
{
printf("Writing...\n");
write_ram_g(4250);
printf("Displaying... ");
Send_CMD(CMD_DLSTART);
Send_CMD(CLEAR_COLOR_RGB(255, 255, 255));
Send_CMD(CLEAR(1, 1, 1));
cmd_setbitmap(RAM_G, ARGB1555, 252, 72);
Send_CMD(BEGIN(BITMAPS));
Send_CMD(VERTEX2II(10, 10, 0, 0));
Send_CMD(END());
Send_CMD(DISPLAY());
Send_CMD(CMD_SWAP);
UpdateFIFO();
printf("done\n");
}

I'm using write_ram_g() to cycle through the bytes in the C array and write them starting at address 0, verify_ram() to print the relevant RAM_G to TeraTerm, and screen_logo() to display the image with a white background.  I can see the white background, but the printed RAM_G is the same as default and no image appears. 

It's clear to me that the image isn't being loaded into RAM_G, does anyone have an in-depth example they could point me to to load a C array into RAM like this?  I am new to loading anything into RAM/flash with the BT817.

2
Discussion - EVE / Touch Returns Incorrect Tag/Track Value
« on: July 22, 2022, 05:19:19 PM »
I am working on a project with a display with a BT817.  I've been working on getting touch functionality implemented, but I keep finding that objects will return the wrong tag. 

I first noticed this when I had two buttons, one with tag 30 and another with tag 31.  Pressing either button would return the tag 31, so I figured that somehow the 30 tag was being overwritten.  However, after changing that button to tag 10, it returned 15 instead.

So to get a sense of how the expected tag mapped to the received one, I held my finger on a button, and in a while loop incremented the button tag and printed out the results.  The pattern I got was seemingly random, with some values shown below:

Sent TagReceived Tag
11
23
33
46
57
67
77
812
913
1015
1115
1214
1315
1415
1515
...and so on.

The only values where the expected tag matched the actual tag are 0, 1, 3, 7, 15, 31, 63, 127, and 255.  In other words, when all bits below the most significant 1 are also 1.

After converting these values to binary, I eventually noticed a pattern: every bit I received was the result of an OR operation with the expected bit and the next highest bit.  So bit0 = bit0 | bit1, bit1 = bit1 | bit2, etc.

I've noticed this pattern with tags for touch objects, as well as the return value for any track object I draw.  Aside from leaving me with only a few valid tags, this means any slider/dial/scrollbar objects are extremely glitchy, as they are being redrawn with  the same values I saw appearing for the tags.

Can anyone help me understand why this is happening?  I'm glad I found the pattern but I don't understand where it's coming from or how to fix it.

Pages: [1]