Teensy 3.5 + HXD8357D 3.5" TFT -- Advice on images

Status
Not open for further replies.

KillaX

New member
Heya, New to the forums. Been using Teensy chips for awhile, number of years for small projects as I find Arduino kinda..big. Love these little boards, only as of recently decided to step up to a Teensy 3.5 ( as I didnt want to deal with 3.3V with the 3.6 ) Though, Honestly, it wouldn't have been hard.

I'm using the "ILI9341_t3" Library with this ( https://tinyurl.com/ph3l2eo Link to Adafruit's Product ) These use HXD8357D Drivers. Which I understand isnt the same. However, with no modifications at all, it works flawlessly. I tried to use DMA one, then running the 2 'old' examples. Both give me failures due to Region/Ram, despite it being a Teensy 3.5. I shoved that aside saying whatever, and resumed using the normal library. So far everything works on it. I can draw bitmaps from the SD card ( On the screen and Teensy 3.5 board ) I decided to go about my case design to take advantage of the Teensy's SD card slot, figuring it would be faster.

http://i.imgur.com/ITZATC3.jpg
As seen here, I'm trying to mimic my car's display screen style. I'm making a volt meter ( more/less just for fun ) which displays a scrolling graph to show voltage history up to a few seconds, Actual voltage readout, and meter. If I use Adafruit's font, I can display live-voltage readout at STUPID fast speeds that makes it unreadable ( but no flicker ). If I use a font, it looks SOOO much nicer, but it's prone to flicker due to having to draw the previous number in dark blue, then draw the new number, to prevent stacking digits, thus causing 4 big blue squares eventually. I get away with it, if I run a low refresh rate. I'm kinda amazed how fast I can make the 260-point array scrolling graph go. Running massive delays in it as if I run no delays, it scrolls by at killer speed..with no flicker ( doing an array shift with drawPixel )

I'm currently REAAAALLY loving the Teensy with this touchscreen LCD. I didnt expect these kinds of speeds ( It's been awhile ) over SPI.

So. Now comes my main questions. I've dug this forum for awhile, and I'm pretty sure I know what I'm going to hear, but...Figure'd ID ask due to this being a totally different screen.

1) Font. Adafruit's font can display extremely fast, with no flickering, as well as background color. Custom font's can as well, but lack background color ability. Manually adding a fix ( display prev-color text or rectangles ) just results in really..really annoying flickers. Is there any real 'fix' around this, to make it run like Adafruit? Or is it best I just stick with a low refresh rate on the digits to prevent flicker. As...lets face it. No one wants 96-Size super pixel fonts. It looks SO much better with the higher quality.

2) BMP files and SD cards. Yes, that question so many have asked.
Bit Depth: 24
Image size: 320x480
Loaded in 2146 ms

Currently, I'm drawing the main HUD as a BMP, then adding active numbers/events on top. However, Due to this being a touch screen, I've added menus for "Touch to alter color" for customization. This requires me to re-draw the background which..is really annoying to see a 2146ms load time. I recently installed Bill's SDFat library, the speed above is what I get. I'm running a old SD card, 64MB..so I'm half guessing that's part of the problem. All my fast SD cards are 64GB and I read somewhere >32GB doesnt work. Running 120Mhz on the CPU Speed. Is there a way to speed this up? I rather not use embedded C file pictures to save space on the chip. I may consider that for the meter, as its curved, and it seams easier to just run the bars in as images VS shapes.

But, Far as I'm aware. I'm not seeing any way to speed things up..specially now that I'm on a better SD library. Using the on-board SD reader. Replacing it with a better SD card is probably my only option? I often wonder if I'm taking full advantage of these HXD8357D drivers..considering I'm using a library made for a different screen.

Just getting ideas. Thanks!
 
But, Far as I'm aware. I'm not seeing any way to speed things up..specially now that I'm on a better SD library.

This is a case where you want the SD card reading more data into memory using SDIO with DMA while you're transmitting the pixels to the display.
 
I did manage to knock it down to 530ms ( 320x480 ) by using a better SD card along with using WriteRect instead of drawPixel. I'll have to dig around for some info on DMA with these screens. I havn't delt with screens in awhile so I'm slowly refreshing myself, messing around with the touchscreen interface, creating menus, etc. Which, things do work, as is. But...obviously if there's the option to get rid of visible loading lines, never hurts to dial it in and perhaps have ability to loads gifs as multiple bmp files. If its under 100x100 pixesl, they load at 22ms which works alright for small little animations ( Like glow effects around a button )

I was going to experiment with the ILI9341_t3DMA library, by Frank. But upon trying to run the demos, I just get Region 'RAM' overflowed by 116092 bytes so.. Didn't get to mess around with that yet. Am making progress though. Doing a lot better than 2 second load times now.
 
I can read 16MB/s with Teensy 3.5 (the SD card does 25MB/s in a fast card reader). The SDFat TeensySdioDemo:

SdFatSdio:
size,write,read
bytes,KB/sec,KB/sec
512,359.66,1616.92
1024,686.84,2481.51
2048,1377.57,4434.04
4096,2662.65,7494.97
8192,4948.02,11429.73
16384,8808.43,14118.15
32768,11362.10,16222.22

SdFatSdioEX:
size,write,read
bytes,KB/sec,KB/sec
512,14049.20,15396.18
1024,13739.18,15662.37
2048,14122.85,16010.96
4096,14253.59,16189.75
8192,14135.01,16281.45
16384,13993.21,16329.21
32768,14223.62,16348.02
 
SDFatStdio:
512,345.38,1818.74
1024,465.17,2387.80
2048,1202.34,4251.00
4096,2712.61,6916.79
8192,5898.63,10268.18
16384,6999.24,13527.33
32768,9469.84,15853.80

SDFatStdioEX:
bytes,KB/sec,KB/sec
512,9845.73,15364.85
1024,14841.55,15645.98
2048,15369.27,15955.54
4096,10472.94,16119.76
8192,10554.80,16193.04
16384,10386.76,16242.92
32768,10529.07,16258.60

It's likely just on the screen side of the code, where using DMA on the screen would likely speed it up, as right now its fetching image data and drawing it out 1 row at a time.

Full-Screen BMP loading via tft.writeRect()
SDFatSdio -- 320x480 -- 24-bit -- 460856 Bits -- Loaded in 523ms
SDFatSdioEX -- 320x480 -- 24-bit -- 460856 Bits -- Loaded in 365ms

So if I had enough space to simply dump the read, into an array, it would load faster. But 320x480 is 153600 of color data...yeah...

Any time I try using Franks or KurtE's library, I can get them both to run on normal operation. But once DMA is enabled ( DMA examples included ) It almost fully compiles until it errors out ".dmabuffers' will not fit in region `RAM'"
(Directory)ld.exe: region `RAM' overflowed by 117856 bytes

( Teensy 3.5 ) the HXD8357D 3.5 does claim to have RAM buffering built into it.
 
As an update. The problem is the screen. It half jankly works ( it compiles and runs corrupt ) if i reinstall teensy package. However when i change it to a 320x480 display, it alarms out due to ram overflow. So i can fudge DMA to work, if i only use a small portion of my screen for the lower res as it was intended for. But i cannot run 320x480 due to the teensy 3.5 not having enough mem. Everything worked fine despite different drivers. It simply cant manage more pixels.
 
Status
Not open for further replies.
Back
Top