[Solved] TFT LCD on Nucleo64-F303 + problems...

What are you developing?
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: TFT LCD on Nucleo64-F303 + problems...

Post by fpiSTM »

Could your share your full example and also the modified library.
This could be fine to see how you do exactly.
alfsch
Posts: 9
Joined: Thu Feb 13, 2020 4:50 pm

Re: TFT LCD on Nucleo64-F303 + problems...

Post by alfsch »

ok...
so first hardware: (was) Nucleo64 F302R8 ; but shit..small flash (didnt realize, when i ordered this. ) so need bigger,
for the design of : LISA (Loudpeaker Impulse Spectrum Analyzer ) , with FFT and a TFT display , mobile running from a LiPo cell.
ok, so first found a F303RET on aliexpress at 3.20 € , incl. postage. ok, removed F302 and now is: Nucleo64 F303RET ! 500KB flash, ok.
TFT (also from ali, about 7 € ) is 400 x 240 pix , with ST7793 controller ;
to get TFT running, the Mcufriend lib need mod, write timing was to fast ( 15ns write puls...TFT shows nothing.)
so with help from David, who made the lib, now good timing; TFT works also with overclocked 96MHz cpu clock (at 120MHz game over.)
this is the modified part, in mcufriend_shield.h :

Code: Select all

#elif defined(STM32F303xE)
#define WRITE_DELAY { WR_ACTIVE2; }  //for alfsch1      was : 2 #define WRITE_DELAY { }
#define READ_DELAY  { RD_ACTIVE8; }  //thanks MasterT
#define GPIO_INIT()   { RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_GPIOCEN; \
                      /* AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_1; */ }
#define PIN_OUTPUT(port, pin) PIN_MODE2((port)->MODER, pin, 0x1) //thanks fpiSTM
now the next problem was: analog input from arduino (standard) was much too slow and only 10bit. i need more...much more.
so with help here from fpiSTM , i could get the F303 ADCs run at their native speed and 12bit , of course.

attached : program , at actual state (running, test graphics and simple ADC input + FFT spectrum test.)
+ touchlib , mod for HAL ADC using
+TFT lib, MCUFRIEND_kbv.cpp, mod is timing in mcufriend_shield.h
+ the mysterious opt file :roll:

-> in zip file, because forum refuses some files to upload, ie XX.ino seems not allowed (you should change this... :o )
TFT_F303_LISA_V3.zip
(9.48 KiB) Downloaded 283 times
MCUFRIEND_kbv-master.zip
(71.44 KiB) Downloaded 283 times
( protective film is still on screen )

8-)
Attachments
lisaP21s.JPG
lisaP21s.JPG (81.03 KiB) Viewed 3573 times
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: TFT LCD on Nucleo64-F303 + problems...

Post by fpiSTM »

Thanks @alfsch .
alfsch wrote: Sat Feb 15, 2020 9:39 am
+ the mysterious opt file :roll:
It is not so mysterious if you read the Wiki. It allows end user to customize the core without change the source. Like this you example is valid across core version.
If the syntax is the issue then use the hal_conf_extra.h ;)

For the size issue, you can try to use the LL ADC instead of the HAL then the size could be decrease a littke bit I hope.
To use the LL ADC, simply include:

Code: Select all

#include "stm32yyxx_ll_adc.h"
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: TFT LCD on Nucleo64-F303 + problems...

Post by ag123 »

+1 nice ! :)
one of those things that i want to make the f303 work is the 4x5msps quad interleaved adc, never quite get down to work on that.
it is probably one of a fastest mcu integrated adc among the stm32f1*, f3*, f4* lines. and it has those 'special' pheriperials like op amps, comparators that are somewhat 'missing' on various skus
Post Reply

Return to “Projects”