[libmaple] FSMC LCD 16bit

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
Post Reply
zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

[libmaple] FSMC LCD 16bit

Post by zmemw16 » Wed Jul 05, 2017 3:28 pm

Black F407VET, latest [libmaple] from Steve, graphicstest from examples, but with blank/black screen?

Code: Select all

TFT LCD test
TFT size is 320x480
TFT begin done.
rotation: 0, runtime: 6082
rotation: 1, runtime: 6081
rotation: 2, runtime: 6083
rotation: 3, runtime: 6082

Benchmark                Time (microseconds)
Screen fill              48116
Text                     6083
Lines                    90352
Horiz/Vert Lines         4257
Rectangles (outline)     2716
Rectangles (filled)      117333
Circles (filled)         41612
Circles (outline)        38206
Triangles (outline)      17330
Triangles (filled)       50977
Rounded rects (outline)  12972
Rounded rects (filled)   135136
Done!
well, that cut and paste took 3 grabs, anyone else having issues doing a cut and paste from the monitor window to elsewhere ?

stephen
Last edited by zmemw16 on Thu Jul 06, 2017 12:39 am, edited 3 times in total.

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: libmaple[FSMC]

Post by stevestrong » Wed Jul 05, 2017 11:39 pm

I just made a new build of the 16 bit lib, and got the test pictures as expected.

Code: Select all

TFT LCD test
TFT size is 320x480
TFT begin done.
rotation: 0, runtime: 5677
rotation: 1, runtime: 5679
rotation: 2, runtime: 5678
rotation: 3, runtime: 5679

Benchmark                Time (microseconds)
Screen fill              48090
Text                     5679
Lines                    83823
Horiz/Vert Lines         4256
Rectangles (outline)     2651
Rectangles (filled)      117318
Circles (filled)         39350
Circles (outline)        35171
Triangles (outline)      23372
Triangles (filled)       50037
Rounded rects (outline)  12155
Rounded rects (filled)   134536
Compared to your results, my version runs mostly faster except the triangle outline test, by which you are 20% faster!
I suppose this is due to the newer compiler version you are using.

You should also get a picture, so please double-check the wiring.
https://www.youtube.com/watch?v=cQXc7nye6Vo

What kind of LCD board do you use?
STM32F4_LCD_FSMC.JPG
STM32F4_LCD_FSMC.JPG (118.14 KiB) Viewed 392 times
For a quick check, I attach my BIN file.
Attachments
graphicstest.ino.bin.txt
(38.59 KiB) Downloaded 37 times
Last edited by stevestrong on Fri Jul 07, 2017 8:12 pm, edited 9 times in total.

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: [libmaple] FSMC

Post by zmemw16 » Thu Jul 06, 2017 12:24 am

you're lucky it wasn't called marple, i was severely tempted :D way, way too much Agatha Christie

is it me or are my timings about 4-5% lower ?

slightly confused by the reference to wiring, the display plugs on to the board.
board source advertised a compatible display, albeit a tad more than standard.
all the wiring is the engagement length of a pin and socket.
i've checked the schematic and the display pinnings are compatible.

if you are using real wires, what have you done with the LCD_BL connection(s?) ?
schematic says it's on PB2. the sketch doesn't seem to use or mention it.

only just spotted you've changed the 16 bit library or am i misreading it?
away to check the repo, i spotted the arduino_stm32 at 32min.
i suppose i want a check and fetch if changed script.

[e2] already had it, written the bin, still blank/black :(

as an aside: there's more than one version of the Black F407ZGT about, silk screen has the white angular shapes around the f407 chip, i've at least one without it.

stephen

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] FSMC LCD 16bit

Post by stevestrong » Thu Jul 06, 2017 7:16 am

I don't use that back-light pin in my software at all, so it is possible that this is missing in your case.
I use a Rpi3 320x480 TFT adapted for 16 bit access. Last change in the library 2 month ago.

Do you have a schematic for your display board, just to figure out what to do with that LCD_BL pin?
zmemw16 wrote:
Thu Jul 06, 2017 12:24 am
is it me or are my timings about 4-5% lower ?
As I mentioned before, it seems so, except triangle (outline) test, where you are 20% faster :shock:
Last edited by stevestrong on Thu Jul 06, 2017 11:40 am, edited 1 time in total.

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: [libmaple] FSMC LCD 16bit

Post by zmemw16 » Thu Jul 06, 2017 11:39 am

steve,
i'm getting worse, there was a bit of code using PB2 with a while(1) :?: it was commented out.
i added setup for it and waggled it at 50/50 mS, also for the leds.
nothing on the display.
looks like i'm doing some wiring.

it does look like it's seen as the 9341 id's are being returned.

i looked through the fsmc code, noted that it won't work for the Black F407ZE.
there're some annotations on the schematic applicable for the ZE variant.
A18-->A6 is one.

stephen

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] FSMC LCD 16bit

Post by stevestrong » Thu Jul 06, 2017 11:53 am

PB2 in the sketch was intended for debugging only, no importance for the functionality, should be removed.

I just checked the black F4Vet board schematic, it seems that PB1 is used to control TFT_BL.
This means, you should set PB1 low in order to give brightness to the display.

Insert in the sketch setup:

Code: Select all

pinMode(PB1, OUTPUT);
digitalWrite(PB1, LOW);
I do not have the ZET board, so someone else has to deal with it.
Roger's repo is anyway almost up-to-date with my one.

User avatar
Pito
Posts: 1593
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: [libmaple] FSMC LCD 16bit

Post by Pito » Thu Jul 06, 2017 12:52 pm

It seems on Black 407ZET the LCD_BL is PB15, connected to a highside pnp switch, where its collector is connected to the TFT's connector pin 28 (and to a pulldown 1k5 as well).
It seems the pin 28 of the ACELEX TFT (when we talk this one) is a logical input as there is a transistor on the TFT board driving most probably the LEDs.
So you have to toggle the PB15 to see at which log level it lits TFT's LEDs..
Pukao Hats Cleaning Services Ltd.

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: [libmaple] FSMC LCD 16bit

Post by zmemw16 » Thu Jul 06, 2017 2:23 pm

add cross eyed to the list
noticed the readID had been 'fixed', removed the fix and ...

Code: Select all

class Adafruit_TFTLCD_16bit_STM32' has no member named 'readID'
it's mainly commented out in the lib examples
but declared

Code: Select all

Adafruit_TFTLCD_16bit_STM32/src/Adafruit_TFTLCD_16bit_STM32.cpp:uint16_t Adafruit_TFTLCD_16bit_STM32::readID(void)
does your display give an ID value, all i'm getting is 0

i'm using a Black F407VE and compatible display(Black ILI9341), LCD_BL from schematic is PB1
i've also got a ZE or two with their correspondingly compatible displays.
ZGT variant, 3 & yes
watch out, there's a pin/socket reversal for the ZE & ZG and a pin count difference as well from the VE

i'll have to do pictures of them all at some point :)

i think i'll try just the control pins and an odd data one to see what's happening ... using pins not fsmc.
you got any code that just tries altering a few pixels on the screen?

stephen

stevestrong
Posts: 1748
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: [libmaple] FSMC LCD 16bit

Post by stevestrong » Thu Jul 06, 2017 2:29 pm

Don't try to read out the ID, it wont work. my board does not have this feature.
But of course, you are invited to implement it if your board supports it.

Just set the identifier to 0x9341 in the graphicstest sketch and it should work.
Don't forget PB1 for LCD_BL.

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: [libmaple] FSMC LCD 16bit

Post by zmemw16 » Thu Jul 06, 2017 3:19 pm

PB1 set low, identifier to 0x9341, blank, nada

@Pito It's a Black F407VE in use at the moment and the same circuitry but uses PB1, adding PB15 on the off chance - no effect
off to waggle control lines ...
srp

Post Reply