Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Display TFT ST7789 (OshonSoft Basic).

DogFlu66

Member
I leave the library to use ST7789 TFT display, I have translated one that is in C language. But unfortunately I have not been able to get it to work yet. I leave the files in case someone with more experience with these displays can review it.
 

Attachments

  • Main_ST7789.bas
    1.5 KB · Views: 168
  • ST7789_240X240.bas
    15 KB · Views: 152
  • _SPI_Library.bas
    6 KB · Views: 161
  • _Pic18F26K22Library.bas
    46.4 KB · Views: 149
  • _SetUpAmicus18.bas
    2.9 KB · Views: 140
Hi Dog.. That was my next move.. I'm making a board so that breadboard capacitance no longer affects it.

We'll see. I was running at 16Mhz with that pic18f26k80 so I should be okay.
 
The 16 MHz bus performs quite well. It’s not ideal for animations, but it is suitable for displaying colored text, graphics to indicate liquid levels, voltages, speeds, etc. Overall, it is more than sufficient for the main purpose of this series of microcontrollers: developing small and medium-scale automation systems.
 
Just had word my two screens will be here soon.
When these are on my pico setup SPI runs ultrafast and animation is really good.
I believe you can achieve 62Mhz.. But they have programable IO cores..
 
Hi C

Have you ever used the IPE from Microchip? I use it when I program pics.. You just plug it in the same as pickit 3 it is supported by the IPE

The IPE is a stand alone program you do not need to open the MPLAB IDE
Hi I,
I've not tried the Microchip IPE, all I found was the MPLAB ones. These seem to overkill for me!
C
 
I have now both 320 x 240 LCD's in my possession.

The ST7789V works off the bat, but the screen is inverted.
The ILI9341 is also working but inverted and backwards and rotated 90 deg.

So the big difference is the MADCTL I'm going to investigate as if we need to rotate the screen here is the big difference.


At the moment I have MADCTL = 0x80. that is all bit manipulation is off and BRG is selected
The inversion is ON this is for the ST7789 ( 240 x 240) so each screen will need "adjusting" to be consistent.
 
Hi,
1st, my previous problems appear to be in the electronics, now sorted out, and Ian's #164 is working perfectly 240x240.

I was playing with the MAIN LOOP settings (Good fun) and find the colours are complimentary to the ones designated. I don't know if it's the same for you? No problem, I can swap the numbers round.

Well done.
C
 
Two settings for colours..

you can use BGR or RGB MADCTL bit 4
Or the INV on or off If balck is white and visa versa.

THEN!! There are the gamma settings so you can mess with the hue.
There are tables on line that people do.. I didn't bother.

Cheers
 
HI I and D,
II changed this: (ILI9341_INVON) to (ILI9341_INVOFF) to get the correct colours.

I tried this: LCD_WIDTH = 320, but it is still 240x240

EDIT Now 240X320
C
 
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top