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: 189
  • ST7789_240X240.bas
    15 KB · Views: 171
  • _SPI_Library.bas
    6 KB · Views: 185
  • _Pic18F26K22Library.bas
    46.4 KB · Views: 174
  • _SetUpAmicus18.bas
    2.9 KB · Views: 161
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, 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:
Hi, :)
At last I've got I's version working (a bit) after a few tweaks.
Now I'll be able to learn how it works.
Cheers, C.
 

Attachments

  • SCREEN.jpg
    SCREEN.jpg
    383.5 KB · Views: 58
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.
 
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.. If you look at that link the st7789 is grayed out. Non stock.

So for now we'll do the ILI..
Hi I,
I think it has changed, because I see it says 'no touch' I didn't see this before. (There is no touch chip) no matter.

I see D uses the ST7789. Should we all be using the same one, for continuity?

OK.
C.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top