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

Pages: [1]
1
TFTs / EVE2 Lines and Bitmaps
« on: October 05, 2018, 10:11:32 PM »
Hi Newhaven!

I'm working on a simple displaylist that has a few lines.
At a glance:
  • Clear
  • 2 bitmaps (L1 then L8) placed with vertex2f
  • 3 white lines
  • green lines:
    • 64 green lines work great. (attached as dl_working_trim.hex)
    • 65 or more green lines cause garbage to be drawn on the display (attached as dl_broken_trim.hex)
Confusingly, if I remove the L8 bitmap, I can draw 65+ green lines without a problem.  If you take a peek at the display lists (1 command per line) you'll see that the broken DL only adds 2 commands (corresponding to a pair of vertex2f invocations to drop another line in the LINES primitive mode, the 65th green line).  I need that L8 bitmap though :-)

The upper garbage red bar does not even smoothly make a rectangle.  Its top row begins ~80% scanned to the right and the bottom row ends ~60% scanned to the right (of the apparent red rectangle).  Both of the garbage bars occur beneath all the lines, and the change that causes them to appear is the uppermost line on the display.

I've attached pictures of the 64 and 65 states, as well as the display lists that produce them.  The display lists were pulled from display memory and stored locally as a straight binary byte-for-byte dump.  I processed them via `hexdump -ve '/4 "%08X\n"' working_displaylist.dump > dl_working.hex` and trimmed to the first 0x00000000 command (END_DISPLAYLIST).  The diff is as expected by adding one green line; near the end of the broken (65 green line) display list, there are 2 commands:
```
diff dl_working_trim.hex dl_broken_trim.hex
159a160,161
> 51381B80
> 51381B40
```

What's going on with this display list?



P.S.  I'm sorry, the forum does not permit attachment of non-image files.  I'll have to paste these text hex displays of the display lists:
Working 64 lines |Broken 65 lines
02000000
26000007
22000000
04000000
1F000001
05000000
07086E91
08136A91
01000000
451812B0
21000000
04400606
1F000001
05000000
071BC08D
0813C08D
01001F27
44701140
21000000
04808080
1F000003
0E000006
44F018C0
44F01C20
44F01C20
52E01C20
52E01C20
52E01410
0E000020
04063006
1F000003
45381B80
45381B40
45681B80
45681B40
45981B80
45981B40
45C81B80
45C81B40
45F81B80
45F81B40
46281B80
46281B40
46581B80
46581B40
46881B80
46881B40
46B81B80
46B81B40
46E81B80
46E81B40
47181B80
47181B40
47481B80
47481B40
47781B80
47781B40
47A81B80
47A81B40
47D81B80
47D81B40
48081B80
48081B40
48381B80
48381B40
48681B80
48681B40
48981B80
48981B40
48C81B80
48C81B40
48F81B80
48F81B40
49281B80
49281B40
49581B80
49581B40
49881B80
49881B40
49B81B80
49B81B40
49E81B80
49E81B40
4A181B80
4A181B40
4A481B80
4A481B40
4A781B80
4A781B40
4AA81B80
4AA81B40
4AD81B80
4AD81B40
4B081B80
4B081B40
4B381B80
4B381B40
4B681B80
4B681B40
4B981B80
4B981B40
4BC81B80
4BC81B40
4BF81B80
4BF81B40
4C281B80
4C281B40
4C581B80
4C581B40
4C881B80
4C881B40
4CB81B80
4CB81B40
4CE81B80
4CE81B40
4D181B80
4D181B40
4D481B80
4D481B40
4D781B80
4D781B40
4DA81B80
4DA81B40
4DD81B80
4DD81B40
4E081B80
4E081B40
4E381B80
4E381B40
4E681B80
4E681B40
4E981B80
4E981B40
4EC81B80
4EC81B40
4EF81B80
4EF81B40
4F281B80
4F281B40
4F581B80
4F581B40
4F881B80
4F881B40
4FB81B80
4FB81B40
4FE81B80
4FE81B40
50181B80
50181B40
50481B80
50481B40
50781B80
50781B40
50A81B80
50A81B40
50D81B80
50D81B40
51081B80
51081B40
21000000
23000000
00000000
02000000
26000007
22000000
04000000
1F000001
05000000
07086E91
08136A91
01000000
451812B0
21000000
04400606
1F000001
05000000
071BC08D
0813C08D
01001F27
44701140
21000000
04808080
1F000003
0E000006
44F018C0
44F01C20
44F01C20
52E01C20
52E01C20
52E01410
0E000020
04063006
1F000003
45381B80
45381B40
45681B80
45681B40
45981B80
45981B40
45C81B80
45C81B40
45F81B80
45F81B40
46281B80
46281B40
46581B80
46581B40
46881B80
46881B40
46B81B80
46B81B40
46E81B80
46E81B40
47181B80
47181B40
47481B80
47481B40
47781B80
47781B40
47A81B80
47A81B40
47D81B80
47D81B40
48081B80
48081B40
48381B80
48381B40
48681B80
48681B40
48981B80
48981B40
48C81B80
48C81B40
48F81B80
48F81B40
49281B80
49281B40
49581B80
49581B40
49881B80
49881B40
49B81B80
49B81B40
49E81B80
49E81B40
4A181B80
4A181B40
4A481B80
4A481B40
4A781B80
4A781B40
4AA81B80
4AA81B40
4AD81B80
4AD81B40
4B081B80
4B081B40
4B381B80
4B381B40
4B681B80
4B681B40
4B981B80
4B981B40
4BC81B80
4BC81B40
4BF81B80
4BF81B40
4C281B80
4C281B40
4C581B80
4C581B40
4C881B80
4C881B40
4CB81B80
4CB81B40
4CE81B80
4CE81B40
4D181B80
4D181B40
4D481B80
4D481B40
4D781B80
4D781B40
4DA81B80
4DA81B40
4DD81B80
4DD81B40
4E081B80
4E081B40
4E381B80
4E381B40
4E681B80
4E681B40
4E981B80
4E981B40
4EC81B80
4EC81B40
4EF81B80
4EF81B40
4F281B80
4F281B40
4F581B80
4F581B40
4F881B80
4F881B40
4FB81B80
4FB81B40
4FE81B80
4FE81B40
50181B80
50181B40
50481B80
50481B40
50781B80
50781B40
50A81B80
50A81B40
50D81B80
50D81B40
51081B80
51081B40
51381B80
51381B40
21000000
23000000
00000000

2
TFTs / EVE2 Palette8 Pixels
« on: July 01, 2018, 02:52:40 PM »
This display is awesome!  I've referenced FTDI's FT81x Series Programmers Guide and implemented a display library, asset management and lightweight display stack for RGB565.  I have a couple needs for small, high quality transparent Paletted8 bitmaps, however.  Here are the bytes that are written to memory, line:[ ] pixel: ():

[ (ff 00 00 ff) (00 ff 00 ff) (00 00 ff ff) ]    [ (ff ff ff 00) (ff ff ff 80) (ff ff ff 00) ]

This is supposed to be RGBA, 3px wide by 2px high.
Top row goes red, green, blue.
Bottom row goes transparent, halfway white transparent, transparent.

On the display there's just garbage.  What is the proper way to store in memory and display a Paletted8 bitmap on EVE2?

Code: [Select]
display_list.begin(bitmaps));
display_list.bitmap_handle(0));
display_list.bitmap_layout(BitmapFormat::Paletted8, width, height));
display_list.bitmap_size(BitmapFilter::nearest, BitmapWrap::border, BitmapWrap::border, width, height));
display_list.bitmap_source(bitmap_location));

// Alpha
display_list.blend(BlendFunction::one, BlendFunction::zero));
display_list.color_mask(0, 0, 0, 1));
display_list.palette_source(bitmap_location + 3));
display_list.vertex2ii(x, y, 0));
display_list.blend(BlendFunction::dst_alpha, BlendFunction::one_minus_dst_alpha));

// Red
display_list.color_mask(1, 0, 0, 0));
display_list.palette_source(bitmap_location));
display_list.vertex2ii(x, y, 0));

// Green
display_list.color_mask(0, 1, 0, 0));
display_list.palette_source(bitmap_location + 1));
display_list.vertex2ii(x, y, 0));

// Blue
display_list.color_mask(0, 0, 1, 0));
display_list.palette_source(bitmap_location + 2));
display_list.vertex2ii(x, y, 0));

Regular 565 2 bytes per pixel works great.  I've got animations and counters working great already, just need to figure out how to draw an RGBA8888 image :-)

I found FTDI's tool for converting PNG's to palette8.  It seems to be broken though - it won't open any png file I can find.  "invalid input file" on anything I've produced or found on the Internet.  I just need the file format and I'll make my own tool!!  What does a palette & index bytewise schema look like?

3
TFTs / EVE2 Startup for 7" Display
« on: May 13, 2018, 02:30:14 AM »
Hi Newhaven folks,

I'm following the FT81x Series Programmer Guide and the DS_FT81x datasheet to set my Newhaven display up and running.  I've been stuck for several days trying to get a hello world working.

My first test is to make a red circle on the screen.  It works very rarely and sometimes makes the circle the wrong size or at the bottom of the screen, sometimes it's only 1/2 or 1/4 circle.  Re-running startup randomly makes the screen kind of work, but the red dot location, size and presence is completely random.

  • 10mhz single SPI.
  • FTDI internal 12mhz crystal, not using external crystal.  (should I?)
  • Particle Photon microcontroller.

Here's what I'm writing to the display, with comments.  I write to the display, then read back what I wrote in a follow-up transaction to see if it "took" properly.  First column is "milliseconds since bootup."

Code: [Select]
0000004092 [app.ft81x.display] INFO: wrote to register: 0x34, wrote: 0x00000320, read: 0x00000320.  good // Sets HSIZE=800
0000004092 [app.ft81x.display] INFO: wrote to register: 0x2c, wrote: 0x000003a0, read: 0x000003a0.  good // Sets HCYCLE=928
0000004093 [app.ft81x.display] INFO: wrote to register: 0x30, wrote: 0x00000058, read: 0x00000058.  good // Sets HOFFSET=88
0000004093 [app.ft81x.display] INFO: wrote to register: 0x38, wrote: 0x00000000, read: 0x00000000.  good // Sets HSYNC0=0
0000004094 [app.ft81x.display] INFO: wrote to register: 0x3c, wrote: 0x00000030, read: 0x00000030.  good // Sets HSYNC1=48
0000004095 [app.ft81x.display] INFO: wrote to register: 0x48, wrote: 0x000001e0, read: 0x000001e0.  good // Sets VSIZE=480
0000004095 [app.ft81x.display] INFO: wrote to register: 0x40, wrote: 0x0000020d, read: 0x0000020d.  good // Sets VCYCLE=525
0000004096 [app.ft81x.display] INFO: wrote to register: 0x44, wrote: 0x00000020, read: 0x00000020.  good // Sets VOFFSET=32
0000004096 [app.ft81x.display] INFO: wrote to register: 0x4c, wrote: 0x00000000, read: 0x00000000.  good // Sets VSYNC0=0
0000004097 [app.ft81x.display] INFO: wrote to register: 0x50, wrote: 0x00000003, read: 0x00000003.  good // Sets VSYNC1=3
0000004097 [app.ft81x.display] INFO: wrote to register: 0x6c, wrote: 0x00000001, read: 0x00000001.  good // Sets PCLK_POL=1 (falling edge, this is a curious setting in Newhaven's documentation)
0000004098 [app.ft81x.display] INFO: wrote to register: 0x68, wrote: 0x00000001, read: 0x00000001.  good // Sets CSPREAD=1
0000004098 [app.ft81x.display] INFO: wrote to register: 0x60, wrote: 0x00000001, read: 0x00000001.  good // Sets DITHER=1
0000004099 [app.ft81x.display] INFO: wrote to register: 0x64, wrote: 0x00000000, read: 0x00000000.  good // Sets SWIZZLE=0
0000004099 [app.ft81x.display] INFO: wrote to register: 0xd4, wrote: 0x00000080, read: 0x00000080.  good // Sets backlight PWM=128 (fully on)
0000004100 [app.ft81x.display] INFO: Settings are set.
0000004100 [app.ft81x.display] INFO: Waited 0ms for display list after register init.                           // This loops to wait for REG_DLSWAP's value to be 0
0000004101 [app.ft81x.display] INFO: Wrote display list: 0, command: 0x04000000, written: 0x04000000.  good // color_rgb(0,0,0) (display list number is (dl_offset)/4 for more convenient log reading)
0000004101 [app.ft81x.display] INFO: Wrote display list: 1, command: 0x26000007, written: 0x26000007.  good // clear(all)
0000004101 [app.ft81x.display] INFO: wrote to register: 0x54, wrote: 0x00000002, read: 0x00000002.  good // Writes 2 to REG_DLSWAP
0000004102 [app.ft81x.display] INFO: wrote to register: 0x70, wrote: 0x00000002, read: 0x00000002.  good // Sets PCLK=2 (Also a curious setting, FTDI programmer guide says this goes after the first display list)
0000004103 [app.ft81x.display] INFO: Waited 0ms for display list ready after initial clear display list. // This loops to wait for REG_DLSWAP's value to be 0
0000004103 [app.ft81x.display] INFO: Wrote display list: 0, command: 0x02000000, written: 0x02000000.  good // dl_ram+00 = color_rgb(0,0,0)
0000004104 [app.ft81x.display] INFO: Wrote display list: 1, command: 0x26000007, written: 0x26000007.  good // dl_ram+04 = clear(all)
0000004104 [app.ft81x.display] INFO: Wrote display list: 2, command: 0x04a01616, written: 0x04a01616.  good // dl_ram+08 = color_rgb(160,22,22)
0000004105 [app.ft81x.display] INFO: Wrote display list: 3, command: 0x0d000140, written: 0x0d000140.  good // dl_ram+12 = point_size(20+16)  (for a 40 pixel diameter circle)
0000004105 [app.ft81x.display] INFO: Wrote display list: 4, command: 0x1f000002, written: 0x1f000002.  good // dl_ram+16 = begin(point)
0000004106 [app.ft81x.display] INFO: Wrote display list: 5, command: 0x38085001, written: 0x38085001.  good // dl_ram+20 = vertex2ii(192,133,0,0)  (to try to drop the circle somewhere on the screen)
0000004106 [app.ft81x.display] INFO: Wrote display list: 6, command: 0x21000000, written: 0x21000000.  good // dl_ram+24 = end()
0000003908 [app.ft81x.display] INFO: wrote to register: 0x54, wrote: 0x00000002, read: 0x00000002.  good // Writes 2 to REG_DLSWAP

Am I interacting with the screen wrong?  Setting wrong settings?

Pages: [1]