ST7735

Use this section to discuss your embedded Flowcode projects.
mnfisher
Valued Contributor
Posts: 953
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: ST7735

Post by mnfisher »

I don't have much PIC kit to test on - except 16lf15313 (which hasn't much RAM (the SD routines need 512 bytes for the buffer ++) - oops and a PIC 16f18877 - I'll give it a whirl on that... One of the hazards of multiple MCUs :-( Might try with an ESP32 as well (there might be a timing issue with faster processors - might need a delay after CS / DC pins are pulled low)

Couple of things to check - is CS set correctly - needs to be connected to B2 on your board..

Try tweaking the prescaler - I'm not sure what speed the display can cope with - and it's running faster than Arduino here (19MHz)

I've had a frustrating afternoon getting SD working - although it's pretty good now (display an image) and working on converting graphics files to lumps of data....

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: ST7735

Post by WingNut »

Yeah cs connected to B2. Tried different prescalers and clock feq and prescaler. Im getting odd flickering so before I can rely on any further testing I think Ill solder the circuit together tomorrow. Ill let you know the results after that. Not overly concerned about the sd card. Did you have to add the 4 connections or is there some internal wiring?

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: ST7735

Post by mnfisher »

Yes - it needed 4 connectors..

Another thing to try - just connect the reset pin to VCC (ignore the 'reset' code completely) - I've been using it this way (actually with reset connected to rst on the Arduino) without problem.

Let us know how you get on - there isn't any AVR specific code, so things should work as is. If only life was like that!

Martin

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: ST7735

Post by WingNut »

Gave that a quick go and no difference but Im not convinced of the breadboard/connections/psu, so Ill finish soldering it all tomorrow and go over all the options again and let you know. Getting a bit fed up with breadboards tbh

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: ST7735

Post by mnfisher »

I had a quick try with an ESP32 and remarkably it worked first time (albeit very slowly).

There are two problems - first the PIN selection for SPI on the ESP just lists all (looks like all) the available pins - but in fact the hardware channels 'map' onto specific pins. This makes life just a little harder than it needs to be..

Second - looking at the UART output it is constantly spitting out:
E (7909) spi_master: check_trans_valid(817): trans tx_buffer should be NULL and SPI_TRANS_USE_TXDATA should be cleared to skip MOSI phase.
I'm not sure if this is something I'm doing wrong - using the wrong pins for example - or if the SPI implementation has a problem - Ben / Martin / Steve - any ideas??

But - other than that it works - random circles drawn at a leisurely pace (due to the UART printed errors on every SPI write)

Putting the SPI into software mode and it works very quickly - and I can send with SPI set at up to 30MHz (40MHz fails - though I'm not sure it will run this fast in software mode?) - strangely after adding a 'WDT disable' - I could only get it to run at 10MHz - but I suspect I'm pushing breadboard and jumpers to the limit here :shock:

I rewired using short jumpers and then working at pretty much any speed (is prescaler correctly named here? - and I'm not sure it does much - setting it at 100khz doesn't appear visibly to different to when set at 80MHz?) -- I'm not sure software mode goes up to 60MHz (or beyond) - but with a WDT blocker it draws splodges pretty fast..


Martin

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: ST7735

Post by WingNut »

Apologies. I didnt get home until late. Soldered all and tried with the background light going off and on to prove the circuit functions (at 1mhz) but it still doesnt display anything. Not had the time to try anything else - hopefully Ill get a chance tomorrow.
Thanks for your efforts Martin

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: ST7735

Post by WingNut »

No success at all :(

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: ST7735

Post by mnfisher »

Sorry to hear that... I'll try with a PIC this evening...

Just to check - which display did you get? I got the AZDelivery (as per your link) - but did you actually get these or a similar model (because the initialisation seems to vary a fair bit between 'brands')

I was optimistic after the ESP32 @ 240MHz !

Martin

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: ST7735

Post by WingNut »

Same one as the link. The ILI9341 seems to work better with it tho. I can get text to display (although limited in size and colour) but because its so slow I cant implement the menu system Ive developed

mnfisher
Valued Contributor
Posts: 953
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 507 times

Re: ST7735

Post by mnfisher »

Okay - I got it working on a PIC..

I used a 16lf15313 (it's what I had) - running at 32MHz. To fit in the limited program space I had to strip some features out (text :-( ) - but I wanted to see if I could get it to work...

After a little fiddling I got it up and running - but, worryingly, I had to turn off the transaction SPI writes (See SendCommand and SendData) - and use byte transfers. It also only worked at prescale of Fosc/16 (or slower).

Using the logic analyser - output didn't decode using transaction write.. Something amiss?

*** Sorted - I had too small a buffer for the data ***

Try this - can easily add back Text for a larger MCU - but would be intesting to know if it works, and if so what is wrong with the transaction code?
st7735 PIC16LF15313fcfx.fcfx
(59.98 KiB) Downloaded 89 times
Martin

Post Reply