EVE2 Startup for 7 inch Display
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."
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?
-
The resolution init settings look to be correct for the 7" display. Please review the example Arduino code that is on our Github page for this 7" display and see if it's possible to convert it to run on the Particle Photon microcontroller.
https://github.com/NewhavenDisplay/EVE2-TFT-Modules/blob/master/7.0in/Capacitive/FT_App_Graph/Project/Arduino/FT_App_Graph/FT_App_Graph.ino0 -
Thanks for the reply! I had a bug with my vertex2ii command bits. I realized this when I was able to tweak the background color. It's now working as expected.
I'm building a more trimmed, straightforward library for my simple consumption (no ifdefs). The next hurdle is bitmap display!0
Please sign in to leave a comment.
Comments
2 comments