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: 132
  • ST7789_240X240.bas
    15 KB · Views: 118
  • _SPI_Library.bas
    6 KB · Views: 131
  • _Pic18F26K22Library.bas
    46.4 KB · Views: 119
  • _SetUpAmicus18.bas
    2.9 KB · Views: 110
Hi,
I'm looking at all of the thread to familiarise it all, I'm completely out of touch.
My screen is shown in #41 and is 240X320 2.8" and the PIC is 18F46K20
I hope this suits your programs.
Cheers, C.
 
Hi, the first thing you need to check is that the chip controlling your LCD is compatible with the one mentioned in the thread title. For now, thanks to Ian, who managed to handle the most challenging part—initializing the display—through his LCD initialization program, some tests with the LCD can now be conducted. I’ve done some basic tests, but between work, writing, and testing the I2C hardware library (which I plan to use with I2C LCDs in the future) for this language, I haven't been able to continue with the thread. I wasn't in a hurry, as I was also waiting for some improvements to be made to the IDE to make working with the somewhat complex LCD libraries more comfortable (which have now been implemented). When I get some time, I'll share a code compatible with the microcontroller you mentioned so you can try out some practices with the LCD. Lastly, the resolution isn't important for now; if it's lower than that of your TFT, the only issue might be that it won't work in full-screen mode.
 
Hi D,
Firstly, there's no hurry for me! I've had a break from technology to clear my mind, and I'll slowly get back into it, with this project. I'm notoriously slow

I'm have your CODES and Ian's, also I'm looking at a video, that looks good, to get familiarised.

If I can get any result, I'll be pleased, and be able to 'play' a little with the settings.
C.
 
If I could get a "full" display.. I can read the ID ergo you could use the same program to report the ID of your display.. In fact, I might just get a bigger one ( like yours ) and write a routine that asks that question.

Most displays will initialize with a basic init routine just so you can report the ID... They are always in the same place with sistronik... and when using ILI types, they have a common ID as well.

ST7735 are almost always small screens. so its not that.. ST7789 go to 240 x 320.. BUT ILI do loads The chinese will use the same layout for MANY screens so if the text said "BLAH BLAH" then you may not know..

MM a member here bought 5 screens with an ST7735. but they cannot be, so I doubt the titles on EBAY and such..
 
A bit more messing, I have found that id you use a 240 x 320 the internal variables are changed..

a 240 x 240 screen has these Col set and Row set values. ( remember rotation changes these.)

col set = 4 params -- start offset hb, start offset lb, end + start offset hb, end + start offset lb,
row set = 4 params -- start offset hb, start offset lb, end + start offset hb, end + start offset lb,

I didn't know this when I tried the 240 x 320.. I kept getting partial writes. BUT the 240 should start at 80 as 320 - 240 = 80, but that didn't work either.

So!! If the offsets and rotation variables internally have to be initialized even if you aren't using them
 
Hi D and I,
Will you tell me which programs to use and INCLUDES if needed to just get any result please?
I tried I's but nothing happened, there also appear to be missing settings that need doing, that may be in 'say' and INCLUDE.

EDIT: There are also soldering errors
C
 
Last edited:
Cam... Where is your code?? The problem with the code I put up was it's for a 240 x 240, hence your border.

Once I get a 320 x 240 I can get rotation up and running and then I can see exactly how CASET and RASET works to set the address..

BUT!! your nearly there..
 
Also.. Remeber what I said earlier... a 240 x 320 CANNOT! have byte parameters..

in the INIT you need words to send to the display ie ColSet_start.LB and ColSet_start.HB ColSet_end.LB and ColSet_end.HB 4 parameters...

Once I get a screen I can see where the pixels are going.
 
Hi I,
Firstly, if you or D are working on another screen, it would be better if either of you send me a link then I'll buy the same type. Maybe they all work with similar CODE after a few tweaks?

I used you CODE, but changed the set up to my usual 18F46K20 on with xtl etc, for the PCB I posted. Also I changed bytes to words. Also I used my working SPI set up.

I found this CODE: https://github.com/adafruit/Adafruit_ILI9341
and had a go at converting it, FUTILE
C.
 
Hang on... that code is for the ILI screen... I though yours was a st7789?
I have code for the ILI9341 that one isn't an issue as I have several pico's with that screen.

I need the link where you got yours.
 
Hang on... that code is for the ILI screen... I though yours was a st7789?
I have code for the ILI9341 that one isn't an issue as I have several pico's with that screen.

I need the link where you got yours.
Hi I,
I have a few screens, but the one here's box is marked:
Serial port modular PCB adaptor micro SD IL19341/ST7789v 5v/3.3v 2.8 inch LED displayfor Ardiono#Color:ST7789

I don't have a link, probably aliexpress?

What ever is easiest for you two, I'll follow.
C
 
Yeah they sell both on aliexpress but the st7789 is unavailable. I'll let you know about the ILI9341 soon.

Not even sure now if its the right one here.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…