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 - Rudolph

Pages: 1 ... 22 23 [24] 25 26 27
346
Discussion - EVE / Re: Is it possible to display several lists on one screen
« on: September 20, 2019, 09:46:26 PM »
Since it already is within my Library I just tried it myself here now.  :)

My mobile is not really capturing it nicely but as you can see in my picture I got it to work.
Check the four numbers under the table, this is my debug output.
This means:
2068 bytes send over SPI
4248 bytes in the resulting display-list
1036 µs to compose the image
26 µs spent for the touch function

So this is only half the FIFO in use and only half the display list filled.
I put all the parts you posted into a single display list.

For the static part that you use with EVE_cmd_append() I could only guess and just put
the drawing of the 5 red lines plus printing the text there.

Likewise, what "{FT813_ShowHex(30 + temp_c*75, Y, Data[temp_c],     2,28,0,ORANGE);}" is actually doing could be hiding what might be your issue.

I translated that into:
Code: [Select]
EVE_cmd_setbase(16L);

Y += 8;
for (temp_c = 0;temp_c < 10; temp_c ++)
{
EVE_cmd_dl(DL_COLOR_RGB | ORANGE);
EVE_cmd_number(30 + temp_c*75, Y, 28, 2, Data[temp_c]);
}
...
EVE_cmd_setbase(10L);

And at first I left out setting the color but then I thought you might be wanting to set the color
for each cell individually based on the values.

This I commented out:
Code: [Select]
EVE_cmd_dl(SCISSOR_XY(0,0));
EVE_cmd_dl(SCISSOR_SIZE(2048,2048) );
EVE_cmd_dl(CLEAR(1,1,1));

This really is pointless after "EVE_cmd_dl(DL_CLEAR | CLR_COL | CLR_STN | CLR_TAG);"


Optimising, well.

I would draw the line-grid in the static part.
Or well, yes, as suggested, just use a picture for the table - and display the picture in the static part.
However, not drawing the grid at all gives me this debug output: 1872 4048 932
That saves a little but printing the 80 numbers is what really is filling the list.

Setting the color only once to orange (while again drawing the grid) results in: 1748 3924 855

So lets see what really is going on there.
Open the EVE Screen Editor and enter:
Code: [Select]
CLEAR(1, 1, 1)
CMD_SETBASE(16)
CMD_NUMBER(572, 272, 28, 0, 42)
CMD_NUMBER(597, 311, 28, 0, 68)

When you switch from the "Coprocessor" tab to the "Inspector" tab you see that these lines are translated into:
Code: [Select]
Raw Text
0 0x26000007 CLEAR(1, 1, 1)
1 0x22000000 SAVE_CONTEXT()
2 0x27000002 VERTEX_FORMAT(2)
3 0x0500001c BITMAP_HANDLE(28)
4 0x1f000001         BEGIN(BITMAPS)
5 0x06000032 CELL(50)
6 0x44780440 VERTEX2F(2288, 1088)
7 0x06000041 CELL(65)
8 0x44900440 VERTEX2F(2336, 1088)
9 0x23000000 RESTORE_CONTEXT()
10 0x22000000 SAVE_CONTEXT()
11 0x27000002 VERTEX_FORMAT(2)
12 0x0500001c BITMAP_HANDLE(28)
13 0x1f000001         BEGIN(BITMAPS)
14 0x06000034 CELL(52)
15 0x44aa04dc VERTEX2F(2388, 1244)
16 0x06000034 CELL(52)
17 0x44c204dc VERTEX2F(2436, 1244)
18 0x23000000 RESTORE_CONTEXT()

So while conveniant, this creates quite some redundant code, that is just the price for it.

To aoid using cmd_number we can easily break this down to:
Code: [Select]
CLEAR(1, 1, 1)
VERTEX_FORMAT(2)
BITMAP_HANDLE(28)
BEGIN(BITMAPS)
CELL(50)
VERTEX2F(2288, 1088)
CELL(65)
VERTEX2F(2336, 1088)
CELL(52)
VERTEX2F(2388, 1244)
CELL(52)
VERTEX2F(2436, 1244)
END()

Also, why cmd_number() is using VERTEX_FORMAT(2) eludes me, we can as well use VERTEX_FORMAT(0).
The coordinates can be fixed, its like VERTEX2F(collum, row) / VERTEX2F(collum+12, row).
That leaves the CELL() commands and these are just ASCII values.
CELL(50) : "2"
CELL(65) : "A"

Okay, lets see what happens.

Code: [Select]
uint8_t hex_table[] = "0123456789ABCDEF";

EVE_cmd_dl(BITMAP_HANDLE(28));
EVE_cmd_dl(DL_BEGIN | EVE_BITMAPS);

Y += 8;
for (temp_c = 0;temp_c < 10; temp_c ++)
{
EVE_cmd_dl(DL_COLOR_RGB | ORANGE);

EVE_cmd_dl(CELL(hex_table[Data[temp_c] >> 4]));
EVE_cmd_dl(VERTEX2F(30 + temp_c*75, Y));

EVE_cmd_dl(CELL(hex_table[Data[temp_c] & 0x0f]));
EVE_cmd_dl(VERTEX2F(42 + temp_c*75, Y));
}
...
EVE_cmd_dl(DL_END);

The result is: 2060 3104 1273

So compared to the original result we have pretty much the same amout of bytes we need to write out by SPI.
The display-list shrinks from 4248 bytes to 3104 bytes - which is quite a lot.
The time to compute this however increases from 1036 µs to 1273 µs.

And it looks exactly the same.


Edit:
I just was curious and with 160 VERTEX2F() this is the perfect test case.
So I pre-calcuted all the coordinates and put them in a table:

Code: [Select]
uint32_t vertex2f_array[20][8];

for(uint8_t Y=0; Y < 8; Y++)
{
for (uint8_t temp_c = 0;temp_c < 10; temp_c ++)
{
vertex2f_array[temp_c*2][Y] = VERTEX2F(30 + temp_c*75, 58+Y*40);
vertex2f_array[1+temp_c*2][Y] = VERTEX2F(42 + temp_c*75, 58+Y*40);
}
}

With the array beeing global.

Then I replaced the code in the loops:
Code: [Select]
for (temp_c = 0;temp_c < 10; temp_c ++)
{
EVE_cmd_dl(DL_COLOR_RGB | ORANGE);
EVE_cmd_dl(CELL(hex_table[Data[temp_c] >> 4]));
// EVE_cmd_dl(VERTEX2F(30 + temp_c*75, Y));
EVE_cmd_dl(vertex2f_array[temp_c*2][0]);
EVE_cmd_dl(CELL(hex_table[Data[temp_c] & 0x0f]));
// EVE_cmd_dl(VERTEX2F(42 + temp_c*75, Y));
EVE_cmd_dl(vertex2f_array[1+temp_c*2][0]);
}

The result is: 2060 3104 1206

So calculating 160 VERTEX2F() takes 67µs on my 48MHz CortexM0+.
That is 0.42µs per VERTEX2F() or ~20 clock cycles.
Even on the 32bit ARM this is somewhat of a bottle-neck.
And this all due to the strange format of VERTEX2F() with X and Y both 15 bit wide and X starting at bit 15.

So, especially on an 8-bit controller, if your visualisation requires a bunch of VERTEX2F() to be
calculated from variables and therefore this can not be optimized during compile-time,
you better make sure to pre-calculate as much of it as you can.

347
Discussion - EVE / Re: BT815 and custom fonts in SPI flash
« on: September 16, 2019, 05:16:26 PM »
Use a bigger FLASH?
EVE takes up to 2Gbit, that is 256 mByte.

348
Discussion - EVE / Re: Loading images with CMD_INFLATE2
« on: September 16, 2019, 05:14:18 PM »
>FLASH is in attached state and I can read/write to it in no-fast mode. No blob is present in the FLASH.

For this to work the FLASH has to be in full-speed mode and for full-speed mode a .blob must be installed.

>First of all, am I wrong in assuming that CMD_INFLATE2 reads the FLASH from an address given by >CMD_FLASHSOURCE? Something like:
Code: [Select]
cmd_flashsource(flash_addr);
cmd_inflate2(ram_g, 64);

Yes, it works this way.

>Secondly, which kind of flash_addr does CMD_INFLATE2 need? A physical address or a >BITMAP_SOURCE-like one (i.e., 0x800000 | phy_addr/32)?

The adress is relative to the FLASH itself, so exactly like in the map file:
unified.blob            : 0     : 4096
map_64x64_ARGB1555.bin  : 4096  : 7040
Wolf_96x96_ARGB1555.bin : 11136 : 5184

Code: [Select]
EVE_cmd_flashsource(4096);
EVE_cmd_inflate2(MEM_PIC2, EVE_OPT_FLASH,0,0);
EVE_cmd_flashsource(11136);
EVE_cmd_inflate2(MEM_PIC3, EVE_OPT_FLASH,0,0);

>Thirdly, what does CMD_INFLATE2 exactly do? Does it read data from FLASH and inflate them on-the-fly,
>writing the result to RAM_G? Or does it read from FLASH, write data to RAM_CMD,
>then command CMD_INFLATE to RAM_G?

As there are no precautions listed this should decompress directly from FLASH to RAM_G.
Otherwise it would destroy whatever commands that are waiting to be executed in RAM_CMD.
And RAM_CMD is only 4kB anyways.

>By the way, byte1 at page 115 starts at byte 12, doesn't it?

Yes, I would think so as well.
And to be consistent with other commands it should be called byte0.



Since cmd_inflate2() is practically a twin of cmd_loadimage() I wonder why we even have cmd_inflate2().
A flag OPT_INFLATE for cmd_loadimage() would have been nice as well, and it could have been defined to include OPT_NODL.

349
Discussion - EVE / Re: BT81x and Animation support
« on: September 12, 2019, 05:52:57 PM »
What version of the EVE Asset Builder are you even using?
The 1.0 does not show this information, it stops at "Number of frames".

So okay, what you are saying is that Animations might be a vital option when you have enough space in the display
list but need to preserve space in the flash.
After I tried animations in the EVE Screen Editor again I have to agree that this looks like a good observation.

I am still getting twice the frames for the animation.data than the animation actually has.
With "CMD_ANIMFRAME(350, 230, 18048, 0)" the even and odd frames are the same.

What has me worried is what a single CMD_ANIMFRAME translates to in the display-list.

My 400x300 sized animation frame is split into 16x16 pixel tiles, okay.
And because many of the tiles look the same the compression ratio is quite high and the display list
is on the shorter end since it requires not so many BITMAP_SOURCE commands.

Okay, so the high compression compared to single frames might only work with very simple animations.
And more complex animations will require even more space in the display list.

Code: [Select]
Raw Text
0 0x22000000 SAVE_CONTEXT()
1 0x0500000f BITMAP_HANDLE(15)
2 0x2c000e60 VERTEX_TRANSLATE_Y(3680)
3 0x2b0015e0 VERTEX_TRANSLATE_X(5600)
4 0x08002020 BITMAP_SIZE(NEAREST, BORDER, BORDER, 16, 32)
5 0x29000000 BITMAP_SIZE_H(0, 0)
6 0x07f84004 BITMAP_LAYOUT(GLFORMAT, 32, 4)
7 0x28000000 BITMAP_LAYOUT_H(0, 0)
8 0x2e0093b7 BITMAP_EXT_FORMAT(COMPRESSED_RGBA_ASTC_8x8_KHR)
9 0x2f0004e5 BITMAP_SWIZZLE(RED, GREEN, BLUE, ALPHA)
10 0x0b00000c BLEND_FUNC(ONE, ONE_MINUS_SRC_ALPHA)
11 0x1f000001 BEGIN(BITMAPS)
12 0x01800080 BITMAP_SOURCE(0x800000 | 128)
13 0x79c07600 VERTEX2F(-3200, -2560)
14 0x7a407600 VERTEX2F(-2944, -2560)
15 0x7ac07600 VERTEX2F(-2688, -2560)
16 0x7b407600 VERTEX2F(-2432, -2560)
17 0x7bc07600 VERTEX2F(-2176, -2560)
18 0x7c407600 VERTEX2F(-1920, -2560)
19 0x7cc07600 VERTEX2F(-1664, -2560)
20 0x7d407600 VERTEX2F(-1408, -2560)
21 0x7dc07600 VERTEX2F(-1152, -2560)
22 0x7e407600 VERTEX2F(-896, -2560)
23 0x7ec07600 VERTEX2F(-640, -2560)
24 0x7f407600 VERTEX2F(-384, -2560)
25 0x7fc07600 VERTEX2F(-128, -2560)
26 0x40407600 VERTEX2F(128, -2560)
27 0x40c07600 VERTEX2F(384, -2560)
28 0x41407600 VERTEX2F(640, -2560)
29 0x41c07600 VERTEX2F(896, -2560)
30 0x42407600 VERTEX2F(1152, -2560)
31 0x42c07600 VERTEX2F(1408, -2560)
32 0x43407600 VERTEX2F(1664, -2560)
33 0x43c07600 VERTEX2F(1920, -2560)
34 0x44407600 VERTEX2F(2176, -2560)
35 0x44c07600 VERTEX2F(2432, -2560)
36 0x45407600 VERTEX2F(2688, -2560)
37 0x45c07600 VERTEX2F(2944, -2560)
38 0x01800084 BITMAP_SOURCE(0x800000 | 132)
39 0x79c07800 VERTEX2F(-3200, -2048)
40 0x7a407800 VERTEX2F(-2944, -2048)
41 0x7ac07800 VERTEX2F(-2688, -2048)
42 0x7b407800 VERTEX2F(-2432, -2048)
43 0x7bc07800 VERTEX2F(-2176, -2048)
44 0x7c407800 VERTEX2F(-1920, -2048)
45 0x7cc07800 VERTEX2F(-1664, -2048)
46 0x7d407800 VERTEX2F(-1408, -2048)
47 0x7dc07800 VERTEX2F(-1152, -2048)
48 0x7e407800 VERTEX2F(-896, -2048)
49 0x7ec07800 VERTEX2F(-640, -2048)
50 0x7f407800 VERTEX2F(-384, -2048)
51 0x7fc07800 VERTEX2F(-128, -2048)
52 0x40407800 VERTEX2F(128, -2048)
53 0x40c07800 VERTEX2F(384, -2048)
54 0x41407800 VERTEX2F(640, -2048)
55 0x41c07800 VERTEX2F(896, -2048)
56 0x42407800 VERTEX2F(1152, -2048)
57 0x42c07800 VERTEX2F(1408, -2048)
58 0x43407800 VERTEX2F(1664, -2048)
59 0x43c07800 VERTEX2F(1920, -2048)
60 0x44407800 VERTEX2F(2176, -2048)
61 0x44c07800 VERTEX2F(2432, -2048)
62 0x45407800 VERTEX2F(2688, -2048)
63 0x45c07800 VERTEX2F(2944, -2048)
64 0x79c07a00 VERTEX2F(-3200, -1536)
65 0x7a407a00 VERTEX2F(-2944, -1536)
66 0x7ac07a00 VERTEX2F(-2688, -1536)
67 0x7b407a00 VERTEX2F(-2432, -1536)
68 0x7bc07a00 VERTEX2F(-2176, -1536)
69 0x7c407a00 VERTEX2F(-1920, -1536)
70 0x7cc07a00 VERTEX2F(-1664, -1536)
71 0x7d407a00 VERTEX2F(-1408, -1536)
72 0x7dc07a00 VERTEX2F(-1152, -1536)
73 0x7e407a00 VERTEX2F(-896, -1536)
74 0x7ec07a00 VERTEX2F(-640, -1536)
75 0x7f407a00 VERTEX2F(-384, -1536)
76 0x7fc07a00 VERTEX2F(-128, -1536)
77 0x40407a00 VERTEX2F(128, -1536)
78 0x40c07a00 VERTEX2F(384, -1536)
79 0x41407a00 VERTEX2F(640, -1536)
80 0x41c07a00 VERTEX2F(896, -1536)
81 0x42407a00 VERTEX2F(1152, -1536)
82 0x42c07a00 VERTEX2F(1408, -1536)
83 0x43407a00 VERTEX2F(1664, -1536)
84 0x43c07a00 VERTEX2F(1920, -1536)
85 0x44407a00 VERTEX2F(2176, -1536)
86 0x44c07a00 VERTEX2F(2432, -1536)
87 0x45407a00 VERTEX2F(2688, -1536)
88 0x45c07a00 VERTEX2F(2944, -1536)
89 0x79c07c00 VERTEX2F(-3200, -1024)
90 0x7a407c00 VERTEX2F(-2944, -1024)
91 0x7ac07c00 VERTEX2F(-2688, -1024)
92 0x7b407c00 VERTEX2F(-2432, -1024)
93 0x7bc07c00 VERTEX2F(-2176, -1024)
94 0x43c07c00 VERTEX2F(1920, -1024)
95 0x44407c00 VERTEX2F(2176, -1024)
96 0x44c07c00 VERTEX2F(2432, -1024)
97 0x45407c00 VERTEX2F(2688, -1024)
98 0x45c07c00 VERTEX2F(2944, -1024)
99 0x79c07e00 VERTEX2F(-3200, -512)
100 0x7a407e00 VERTEX2F(-2944, -512)
101 0x7ac07e00 VERTEX2F(-2688, -512)
102 0x7b407e00 VERTEX2F(-2432, -512)
103 0x7bc07e00 VERTEX2F(-2176, -512)
104 0x7e407e00 VERTEX2F(-896, -512)
105 0x7ec07e00 VERTEX2F(-640, -512)
106 0x7f407e00 VERTEX2F(-384, -512)
107 0x7fc07e00 VERTEX2F(-128, -512)
108 0x40407e00 VERTEX2F(128, -512)
109 0x40c07e00 VERTEX2F(384, -512)
110 0x41407e00 VERTEX2F(640, -512)
111 0x41c07e00 VERTEX2F(896, -512)
112 0x42407e00 VERTEX2F(1152, -512)
113 0x43c07e00 VERTEX2F(1920, -512)
114 0x44407e00 VERTEX2F(2176, -512)
115 0x44c07e00 VERTEX2F(2432, -512)
116 0x45407e00 VERTEX2F(2688, -512)
117 0x45c07e00 VERTEX2F(2944, -512)
118 0x79c00000 VERTEX2F(-3200, 0)
119 0x7a400000 VERTEX2F(-2944, 0)
120 0x7ac00000 VERTEX2F(-2688, 0)
121 0x7b400000 VERTEX2F(-2432, 0)
122 0x7bc00000 VERTEX2F(-2176, 0)
123 0x7e400000 VERTEX2F(-896, 0)
124 0x7ec00000 VERTEX2F(-640, 0)
125 0x7f400000 VERTEX2F(-384, 0)
126 0x7fc00000 VERTEX2F(-128, 0)
127 0x40400000 VERTEX2F(128, 0)
128 0x40c00000 VERTEX2F(384, 0)
129 0x41400000 VERTEX2F(640, 0)
130 0x41c00000 VERTEX2F(896, 0)
131 0x42400000 VERTEX2F(1152, 0)
132 0x43c00000 VERTEX2F(1920, 0)
133 0x44400000 VERTEX2F(2176, 0)
134 0x44c00000 VERTEX2F(2432, 0)
135 0x45400000 VERTEX2F(2688, 0)
136 0x45c00000 VERTEX2F(2944, 0)
137 0x79c00200 VERTEX2F(-3200, 512)
138 0x7a400200 VERTEX2F(-2944, 512)
139 0x7ac00200 VERTEX2F(-2688, 512)
140 0x7b400200 VERTEX2F(-2432, 512)
141 0x7bc00200 VERTEX2F(-2176, 512)
142 0x43c00200 VERTEX2F(1920, 512)
143 0x44400200 VERTEX2F(2176, 512)
144 0x44c00200 VERTEX2F(2432, 512)
145 0x45400200 VERTEX2F(2688, 512)
146 0x45c00200 VERTEX2F(2944, 512)
147 0x79c00400 VERTEX2F(-3200, 1024)
148 0x7a400400 VERTEX2F(-2944, 1024)
149 0x7ac00400 VERTEX2F(-2688, 1024)
150 0x7b400400 VERTEX2F(-2432, 1024)
151 0x7bc00400 VERTEX2F(-2176, 1024)
152 0x7c400400 VERTEX2F(-1920, 1024)
153 0x7cc00400 VERTEX2F(-1664, 1024)
154 0x7d400400 VERTEX2F(-1408, 1024)
155 0x7dc00400 VERTEX2F(-1152, 1024)
156 0x7e400400 VERTEX2F(-896, 1024)
157 0x7ec00400 VERTEX2F(-640, 1024)
158 0x7f400400 VERTEX2F(-384, 1024)
159 0x7fc00400 VERTEX2F(-128, 1024)
160 0x40400400 VERTEX2F(128, 1024)
161 0x40c00400 VERTEX2F(384, 1024)
162 0x41400400 VERTEX2F(640, 1024)
163 0x41c00400 VERTEX2F(896, 1024)
164 0x42400400 VERTEX2F(1152, 1024)
165 0x42c00400 VERTEX2F(1408, 1024)
166 0x43400400 VERTEX2F(1664, 1024)
167 0x43c00400 VERTEX2F(1920, 1024)
168 0x44400400 VERTEX2F(2176, 1024)
169 0x44c00400 VERTEX2F(2432, 1024)
170 0x45400400 VERTEX2F(2688, 1024)
171 0x45c00400 VERTEX2F(2944, 1024)
172 0x79c00600 VERTEX2F(-3200, 1536)
173 0x7a400600 VERTEX2F(-2944, 1536)
174 0x7ac00600 VERTEX2F(-2688, 1536)
175 0x7b400600 VERTEX2F(-2432, 1536)
176 0x7bc00600 VERTEX2F(-2176, 1536)
177 0x7c400600 VERTEX2F(-1920, 1536)
178 0x7cc00600 VERTEX2F(-1664, 1536)
179 0x7d400600 VERTEX2F(-1408, 1536)
180 0x7dc00600 VERTEX2F(-1152, 1536)
181 0x7e400600 VERTEX2F(-896, 1536)
182 0x7ec00600 VERTEX2F(-640, 1536)
183 0x7f400600 VERTEX2F(-384, 1536)
184 0x7fc00600 VERTEX2F(-128, 1536)
185 0x40400600 VERTEX2F(128, 1536)
186 0x40c00600 VERTEX2F(384, 1536)
187 0x41400600 VERTEX2F(640, 1536)
188 0x41c00600 VERTEX2F(896, 1536)
189 0x42400600 VERTEX2F(1152, 1536)
190 0x42c00600 VERTEX2F(1408, 1536)
191 0x43400600 VERTEX2F(1664, 1536)
192 0x43c00600 VERTEX2F(1920, 1536)
193 0x44400600 VERTEX2F(2176, 1536)
194 0x44c00600 VERTEX2F(2432, 1536)
195 0x45400600 VERTEX2F(2688, 1536)
196 0x45c00600 VERTEX2F(2944, 1536)
197 0x01800088 BITMAP_SOURCE(0x800000 | 136)
198 0x7c407c00 VERTEX2F(-1920, -1024)
199 0x0180008c BITMAP_SOURCE(0x800000 | 140)
200 0x7cc07c00 VERTEX2F(-1664, -1024)
201 0x01800090 BITMAP_SOURCE(0x800000 | 144)
202 0x7d407c00 VERTEX2F(-1408, -1024)
203 0x01800094 BITMAP_SOURCE(0x800000 | 148)
204 0x7dc07c00 VERTEX2F(-1152, -1024)
205 0x01800098 BITMAP_SOURCE(0x800000 | 152)
206 0x7e407c00 VERTEX2F(-896, -1024)
207 0x7ec07c00 VERTEX2F(-640, -1024)
208 0x7f407c00 VERTEX2F(-384, -1024)
209 0x7fc07c00 VERTEX2F(-128, -1024)
210 0x40407c00 VERTEX2F(128, -1024)
211 0x40c07c00 VERTEX2F(384, -1024)
212 0x41407c00 VERTEX2F(640, -1024)
213 0x41c07c00 VERTEX2F(896, -1024)
214 0x0180009c BITMAP_SOURCE(0x800000 | 156)
215 0x42407c00 VERTEX2F(1152, -1024)
216 0x018000a0 BITMAP_SOURCE(0x800000 | 160)
217 0x42c07c00 VERTEX2F(1408, -1024)
218 0x018000a4 BITMAP_SOURCE(0x800000 | 164)
219 0x43407c00 VERTEX2F(1664, -1024)
220 0x018000a8 BITMAP_SOURCE(0x800000 | 168)
221 0x7c407e00 VERTEX2F(-1920, -512)
222 0x7c400000 VERTEX2F(-1920, 0)
223 0x018000ac BITMAP_SOURCE(0x800000 | 172)
224 0x7cc07e00 VERTEX2F(-1664, -512)
225 0x7cc00000 VERTEX2F(-1664, 0)
226 0x018000b0 BITMAP_SOURCE(0x800000 | 176)
227 0x7d407e00 VERTEX2F(-1408, -512)
228 0x7d400000 VERTEX2F(-1408, 0)
229 0x018000b4 BITMAP_SOURCE(0x800000 | 180)
230 0x7dc07e00 VERTEX2F(-1152, -512)
231 0x7dc00000 VERTEX2F(-1152, 0)
232 0x018000b8 BITMAP_SOURCE(0x800000 | 184)
233 0x42c07e00 VERTEX2F(1408, -512)
234 0x42c00000 VERTEX2F(1408, 0)
235 0x018000bc BITMAP_SOURCE(0x800000 | 188)
236 0x43407e00 VERTEX2F(1664, -512)
237 0x018000c0 BITMAP_SOURCE(0x800000 | 192)
238 0x43400000 VERTEX2F(1664, 0)
239 0x018000c4 BITMAP_SOURCE(0x800000 | 196)
240 0x7c400200 VERTEX2F(-1920, 512)
241 0x018000c8 BITMAP_SOURCE(0x800000 | 200)
242 0x7cc00200 VERTEX2F(-1664, 512)
243 0x018000cc BITMAP_SOURCE(0x800000 | 204)
244 0x7d400200 VERTEX2F(-1408, 512)
245 0x018000d0 BITMAP_SOURCE(0x800000 | 208)
246 0x7dc00200 VERTEX2F(-1152, 512)
247 0x018000d4 BITMAP_SOURCE(0x800000 | 212)
248 0x7e400200 VERTEX2F(-896, 512)
249 0x7ec00200 VERTEX2F(-640, 512)
250 0x7f400200 VERTEX2F(-384, 512)
251 0x7fc00200 VERTEX2F(-128, 512)
252 0x40400200 VERTEX2F(128, 512)
253 0x40c00200 VERTEX2F(384, 512)
254 0x41400200 VERTEX2F(640, 512)
255 0x41c00200 VERTEX2F(896, 512)
256 0x018000d8 BITMAP_SOURCE(0x800000 | 216)
257 0x42400200 VERTEX2F(1152, 512)
258 0x018000dc BITMAP_SOURCE(0x800000 | 220)
259 0x42c00200 VERTEX2F(1408, 512)
260 0x018000e0 BITMAP_SOURCE(0x800000 | 224)
261 0x43400200 VERTEX2F(1664, 512)
262 0x018000e4 BITMAP_SOURCE(0x800000 | 228)
263 0x79c00800 VERTEX2F(-3200, 2048)
264 0x7a400800 VERTEX2F(-2944, 2048)
265 0x7ac00800 VERTEX2F(-2688, 2048)
266 0x7b400800 VERTEX2F(-2432, 2048)
267 0x7bc00800 VERTEX2F(-2176, 2048)
268 0x7c400800 VERTEX2F(-1920, 2048)
269 0x7cc00800 VERTEX2F(-1664, 2048)
270 0x7d400800 VERTEX2F(-1408, 2048)
271 0x7dc00800 VERTEX2F(-1152, 2048)
272 0x7e400800 VERTEX2F(-896, 2048)
273 0x7ec00800 VERTEX2F(-640, 2048)
274 0x7f400800 VERTEX2F(-384, 2048)
275 0x7fc00800 VERTEX2F(-128, 2048)
276 0x40400800 VERTEX2F(128, 2048)
277 0x40c00800 VERTEX2F(384, 2048)
278 0x41400800 VERTEX2F(640, 2048)
279 0x41c00800 VERTEX2F(896, 2048)
280 0x42400800 VERTEX2F(1152, 2048)
281 0x42c00800 VERTEX2F(1408, 2048)
282 0x43400800 VERTEX2F(1664, 2048)
283 0x43c00800 VERTEX2F(1920, 2048)
284 0x44400800 VERTEX2F(2176, 2048)
285 0x44c00800 VERTEX2F(2432, 2048)
286 0x45400800 VERTEX2F(2688, 2048)
287 0x45c00800 VERTEX2F(2944, 2048)
288 0x23000000 RESTORE_CONTEXT()

350
Discussion - EVE / Re: BT815 and custom fonts in SPI flash
« on: September 11, 2019, 05:31:26 PM »
Unfortunately, you must load any custom font data from the flash into RAM_G before it can be used by EVE.

I don't know, but isn't that answer a little generic?
This somehow implies that BT815 can not use any font from FLASH while only legacy fonts can not be used from FLASH.

So re-converting the fonts to extended format with ASTC compression would be the way to go.
Only the font structure for some reason still needs to be loaded into RAM_G, but it is way smaller than the glyphs.

351
Discussion - EVE / Re: BT81x and Animation support
« on: September 10, 2019, 04:53:03 PM »
Yes, this is kind of what I wrote already.
Depending on the size of the image I would prefer using a single image though and make use of CELL().

The point however was specifically the new animation functionality.
And right now It looks to me like a pointless way to waste precious space in the display-list.

I kind of hope that I am wrong with this and that I am missing something.
But to find out someone from Bridgetek would need to elaborate and what benefits this functionality has.

352
Discussion - EVE / Re: implementing support for formated strings
« on: August 30, 2019, 05:12:38 PM »
I know that BT81x supports varargs calling for CMD_BUTTON, CMD_TEXT and CMD_TOGGLE.
You still need a wrapper function to put out all the bits on the SPI.

But I can not find a way to implement a function in C
 cmd_text(int16_t x0, int16_t y0, int16_t font, uint16_t options, const char* text, ...)
that is sending the command, the string and all parameters thru SPI.

The varargs API requires that the type and number of arguments are known.
There is no way to just loop thru the arguments.

From the BT81x programming guide we know that only integer arguments are allowed and each argument has to
end up on the SPI as 32 bit value.
So we can get away with:
 x = (uint32_t) va_arg(arguments, int);

To determine the number of arguments however we either need to parse the string or add annother argument.
 cmd_text(int16_t x0, int16_t y0, int16_t font, uint16_t options, const char* text, num_args, ...)

Parsing the string makes the functionality mostly pointless since we could use sprintf() to do that.
And adding annother argument breaks existing code.

So I added EVE_cmd_text_var(), EVE_cmd_button_var() and EVE_cmd_toggle_var() functions that need the number
of additional arguments.


353
Discussion - EVE / Re: Abort pending swap
« on: August 30, 2019, 04:51:40 PM »
Just relax and implement a state based display refresh then?

Code: [Select]
20ms_task()
{
  display_refresh();
}

display_refresh()
{
 if(alarm)
 {
  display_screen_alarm();
}
else
{
 switch(screen)
 {
  case 0:
       display_splash_screen;
       break;
  case 1:
       display_screen_1;
       break;
  case 2:
       display_screen_2;
       break;
  default:
       display_splash_screen;
       break;
 }
}

Just let it flow.

>and when the swap interrupt has been triggered

The only interrupt I am using is the end-of-dma Interrupt to execute the display-list that has been written and that resets the flag
that indicates that the SPI is busy.

>I simply want predictable data-transfer times across SPI to the EVE.

Putting it on a timer and therefore updating the screen asynchronously makes it very predictable.

And it is a human-machine-interface, the user will not notice if there are only a few ms delay betwen touching a button and
the visual feedback for it.

354
Discussion - EVE / Re: Clear the co-processor command fifo
« on: August 28, 2019, 03:48:54 PM »
>** Side note regarding REG_COPRO_PATCH_PTR: I'm seeing conflicting info on properly using this register during the reset.  >According to the register definition, this is a 16-bit read-only register, however the matrix orbital github code is using 32-bit >operations on it.  During my tests, I've tried both sizes, and even omitting the patch pointer write from the reset.  All 3 of >these cases gave me the same result.

All registers are 4-byte aligned, other bits than specified are reserved.

I am more curious about the registers that are not specified or specifically marked as reserved. :-)
Same for the undocumented commands. :-)

And a side note from me, the offset for REG_SPI_WIDTH is still wrong in the "BT81X Series Programming Guide" Version 1.1.
0x188 would be correct but it still says 0x180.

355
Discussion - EVE / Re: Abort pending swap
« on: August 28, 2019, 03:30:25 PM »
You forgot to mention why you believe that would need this in the first place.
What is the issue that needs fixing with this?

And there is only a very narrow time-window for such an operation to even work, and unpredictable since it depends
on how far the current frame is rendered before REG_DLSWAP is written with DLSWAP_FRAME.
It could take from no time at all to a full frame.

356
Discussion - EVE / Re: unified blob in BT815
« on: August 28, 2019, 03:14:08 PM »
>That typo is not seen on my version EAB 1.0.  You might be using old version.

No, I am not, I am using EAB 1.0.

I started EAB, it said 1.0.
I erased it, installed it again, tried to flash unified.blob again and the log still ended with "Existing ...".
So I downloaded the archive from https://brtchip.com/eve-toolchains/#EVEAssetBuilder again,
compared the files, the fresh EVE-Asset-Builder-setup-1.0.exe is 100% the same as the one I downloaded earlier.
I installed it again: "Existing ..."
I erased the folder again, installed it again: "Existing ..."
I opened the folder C:\Users\Ich\Documents\EVE Asset Builder opened a shell, executed progflash.exe.

C:\Users\Ich\Documents\EVE Asset Builder>progflash
Welcome to BT81X Flash Programming Utility V0.0.5

C:\Users\Ich\Documents\EVE Asset Builder>progflash module MPSSE newblob unified.blob
 Information on channel number 0:
 Flags=0x2
...
Error, Flash is not able to get into full mode
Fail to write Blob file "unified.blob" to BT81X Flash Storage
Existing ...


357
Discussion - EVE / Re: unified blob in BT815
« on: August 26, 2019, 10:07:51 PM »
>you may want to check CMD_FLASHFAST: in my case it returned error 0xE002 (no header detected).

I just tried that and it does return 0xE002.
And it really should return 0xE002 - because the FLASH is empty,
I put a new one on the board and erased it.

>I do not know what info is in the blob

My guess is that this is code for the FT900 like controller in EVE.

>Have you checked REG_FLASH_SIZE? Does it tell you the correct size of your flash chip?

Yes, I have and it reads "8" which is correct for my chip.
And REG_FLASH_STATUS reads "2" which is FLASH_STATUS_BASIC, good to go to be programmed.

And still cmd_flashwrite() fails, nothing gets written and it fails silently without triggering a coprocessor fault.

>and get the FlashUpdate command working because it is a lot easier and faster than chip erase:

Oh, I am pretty sure I got it working, I did not use it so far though.
First the chip already is erased, then it requires to place the data in the ram-g first and to repeat
myself, cmd_flashupdate is not part of the table on page 17.
It should work in BASIC and FULL mode, but the table does not contain this information.
So I am going with cmd_flashwrite for now and it works exactly as it should on my other display.
Okay, okay, I tried using cmd_flashupdate now and it did not work either.

> it also leaves your sector 1 intact.

I really hope it does not because I am trying to write to sector 1 to get the blob installed...


358
Discussion - EVE / Re: EVE3 - Asynchronous display-list updates
« on: August 22, 2019, 06:26:40 PM »
>Perhaps your constraints aren't the same as the ones I'm managing in my own work?

Most certainly, I do not even have the same constraints from one project to annother. :-)

>in my own setup, an entire 8K list could be sent in about 2ms

This implies that you either use more than the 30MHz allowed on the SPI or that you use dual or quad SPI.
A raw transfer of 8k at 30MHz without overhead would take 2.2ms.

In either case this implies that you are using a higher clocked 32 bit controller.
And if that is true - why not use DMA?

I am using plain single-line SPI transfers (at least for now), with the ATSAMC21 currently "restricted" to 12MHz since I have a problem with the MISO
line at 24MHz and did not bother to setup annother clock-source to allow for something in between.

In my last more "complex" GUI I had a single page with 26 buttons in 6 different shapes.
Each button had three states, off, active and touched, indicated by different colors for off/active and different images for touch/not touched.
The buttons were using images with 2 sub-images each.
The texts for the 12 main buttons were done with an image with 13 sub-images and which "text" is shown can actually be configured on the fly by CAN messages.
What I am using in total as buttons has 39 states so to speak.

In addtion there were a couple of graphical elements, like 12 indicator "leds", 6 moving "pointers", two logos, several lines and rectangles, some plain text, annother grafik to indicate something by changing color and a text-output status line.

The result was 1124 bytes to be send over SPI resulting in a 2872 byte long display list and composing the list from a precalculated snippet for the static parts plus everything else that could be changed takes 667µs - all with an empty status line.
The 1124 bytes are send with DMA in one large block which takes about 750µs

Just for reference, when you place 26 button widgets in EVE Screen Editor and nothing else, the RAM_DL is filled by 75%.

The attached image is from a way simpler GUI and only to show that I use a burst-mode, this is a single large transfer, followed by a small one to write REG_CMD_WRITE.

Yes, I could drive this further with splitting this up into snippets.
And since part of my optimisations was to sort thru the various elements in order to avoid sending commands like COLOR_RGB over and over again, using snippets would make the code more readable at the cost of a longer display list.
But my goal was to get below 1ms for the display refresh function that is called once every 20ms.
And I got there.

Next time I maybe pick up on the idea to use a whole lot more different snippets.
Just as a guess, I assume it would take 16 commands per button, should be less, that would be 64 bytes.
6 * 39 * 64 = 14976
Yes, why not, in my last project I used 3x 4k from the top for three snippets and 5056 bytes from the bottom for a single .xfont file.
This left 1031232 bytes of SRAM unused since all my images and the UTF-8 font were used directly from the external FLASH of the BT815.
I rather spend 64k on snippets than refreshing these.



359
Discussion - EVE / Re: EVE3 - Asynchronous display-list updates
« on: August 16, 2019, 05:11:33 PM »
I still have no idea what "issue" you are trying to fix in the first place.

Given that the resulting display list is within 8kB - and you always have to make sure it does - I can think of no issue, even when you try to rebuild snippets for the display list over and over.

Even if you just placed your display-list for build from snippets thru the co-processor and immeadiately after this
issue more commands thru the co-processor to update the snippets, it does not matter since all commands are executed sequentially anyways.
You need to make sure that you are not overloading the FIFO but again, you always need to take care of that and since the co-processer is rather fast when processing the FIFO you really would need to put some effort into racing it.

So I guess you could write display-list snippets directly to RAM-GL but not only is this a bad idea on its own, you could easily check if the co-processor is still busy with the display list.
Since you must not try to swap the display list faster than it is displayed, you can easily refresh the snippets in the 17ms you are not refreshing.

The argument that a display list could be without an update for a whole whopping frame is void when you put the updating of the snippets right before building a new list every 17+ ms.

And on top, why do you refresh your snippets anyways?
Everytime you do you could as well send the exact same commands thru the co-processor instead of using cmd_append afterwards, the SPI traffic sure is a little lower, but only for all the frames you do not refresh that snippet.
It more or less only makes the amount of SPI traffic unpredictable and you need to make sure that your programm is still running as it is supposed to in the worst case.

Saving memory could be raised as reason to refresh the snippets.
But first off the display-list is only 8kB long.
How many times that do you need in snippets to make it a problem?
And since for a example a button uses a different amount of memory if displayed normal or flat, you would either allocate the maximum amount for the snippet or implement some memory management.
Investing a little memory to pre-calculate two different snippets would be easier in this case.
And avoid using cmd_button in favour of two button images would make both snippets significantly smaller.
Plus since we are talking about EVE3 you could as well pre-calculate the snippets, put them in the FLASH and then use cmd_appendf to place the snippets from flash in the display-list.

I am afraid that you spent a whole lot of time solving something that is not an issue in the first place.

360
Discussion - EVE / Re: unified blob in BT815
« on: August 15, 2019, 08:51:23 PM »
I am not sure but I might have used 0x800000 as target as well.
But I misplaced that code somehow.
So I tried it again with 0x0000000 as target adress.

And this time it worked on my EVE3-50G on which I replaced the 32MBit flash with a 128MBit type.

I generated a flash.bin with the EVE Asset Builder containing two pictures.
Then I wrote this flash.bin with the EVE Asset Builder to check if my code does display the images correctly and it does.
So I erased the flash with the EVE Asset Builder and linked the flash.bin to my programm.
I added a few lines to execute a cmd_flashwrite() in case the flash status is "2" after trying to put it into FULL mode.
The flash.bin is 22528 bytes long and it gets written now the first time my programm runs after erasing the flash.
After a reset the images are displayed.

The RVT43ULBNWC00 however that I put a SST26VF064BA-101I/SM on is a totally different story.
I can erase the flash just fine with the EVE Asset Builder.
And from my software I can tell it gets detected by the BT815 and put into "BASIC" mode.
But cmd_flashwrite() just silently fails doing nothing.

And when I use the EVE Asset Builder to write the flash.bin I get this:

----
Write D:.../Flash/flash.bin to flash unsuccessfully!
Log:
 Information on channel number 0:
 Flags=0x2
 Type=0x8
 ID=0x4036014
 LocId=0x432
 SerialNumber=
 Description=Single RS232-HS
 ftHandle=0x0

handle=0x76edb8 status=0x0
VC1 register ID after wake up 7c

 reg_touch_rz =0x7fff
 reg_touch_rzthresh =0xffff
 reg_touch_tag_xy=0x80008000
 reg_touch_tag=0x0

Writing Blob file ".\unified.blob" to BT81X Flash Storage
Error, Flash is not able to get into full mode
Fail to write Blob file ".\unified.blob" to BT81X Flash Storage
Existing ...
----

Oh yes, that "Existing" is a typo in the flashtool. :-)

But I wrote it before somewhere else in this forum, the rest of the message is also a bit strange.
Why is the flashtool still insisting on writing "unified.blob" while the blob already is part of the flash.bin?
"Error, Flash is not able to get into full mode" - why is this error even there? Why does it even try to put the flash into full mode?

Bottom line, neither the EVE Asset Builder or my software can write to the Flash of my choice,
is there anything that can be done about this?
Or is there even a reason to this, some incompatibility that maybe is shared with other Flash chips?







Pages: 1 ... 22 23 [24] 25 26 27