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: 203
  • ST7789_240X240.bas
    15 KB · Views: 181
  • _SPI_Library.bas
    6 KB · Views: 193
  • _Pic18F26K22Library.bas
    46.4 KB · Views: 182
  • _SetUpAmicus18.bas
    2.9 KB · Views: 174
Hi,
You may have followed my other threads, where I prove that I'm not a natural programmer, and on the main other thread, after 5 years of development, I failed to finalise it.
This thread is going the same way for me.
It seems like we all have a different way of programming, that I find simply to hard to follow everybody.

I'm going to drop out of this one, as it just too hard for me.
As you can see from my posts here, I have programs working using others CODE along with mine. I'll just play with these is my simple way and see what I can do.

Thanks for all of your efforts.
C
 
Hi,
You may have followed my other threads, where I prove that I'm not a natural programmer, and on the main other thread, after 5 years of development, I failed to finalise it.
This thread is going the same way for me.
It seems like we all have a different way of programming, that I find simply to hard to follow everybody.

I'm going to drop out of this one, as it just too hard for me.
As you can see from my posts here, I have programs working using others CODE along with mine. I'll just play with these is my simple way and see what I can do.

Thanks for all of your efforts.
C
What is not working for you?. Have you tried the example (thread #267) that I posted for TFT ILI9341 with Pic18F46K20 microcontroller?.
If it does not work for you, I recommend that you update the Oshonsoft Pic Basic.

The example works with a 32Mhz oscillator and an 8Mhz SPI bus, in case your display does not work with the 8Mhz SPI bus (your display is slower) you can lower the speed to 2Mhz by changing:
Call LCD_SPI1_Init(LCD_SPI_MODE2, LCD_SPI_MASTER_SPEED0 | LCD_SPI_ENABLE) 'CLK 8Mhz (32Mhz) by Call LCD_SPI1_Init(LCD_SPI_MODE2, LCD_SPI_MASTER_SPEED1 | LCD_SPI_ENABLE) 'CLK 2Mhz (32Mhz)

Which card should I use anyway?.
 
Last edited:
If its any consolation, I know I've been missing ( work and Christmas ) but I cannot get your board to give a decent clock pulse, So If I cannot, well...

Never give up..
Hi I,
I'm long retired now, but I remember the days when I had to work Christmas and new years day, I dare say that you had a bit of cake ? There's no hurry.

Regarding the clock! Do you mean the SPI CLK or the OSC?
If it was the SPI CLK, then did you see my analyser posting?

Perhaps if you let me know in detail, what you did exactly, I'll do the same and post my result.
C
 
Last edited:
What is not working for you?. Have you tried the example (thread #267) that I posted for TFT ILI9341 with Pic18F46K20 microcontroller?.
If it does not work for you, I recommend that you update the Oshonsoft Pic Basic.

The example works with a 32Mhz oscillator and an 8Mhz SPI bus, in case your display does not work with the 8Mhz SPI bus (your display is slower) you can lower the speed to 2Mhz by changing:
Call LCD_SPI1_Init(LCD_SPI_MODE2, LCD_SPI_MASTER_SPEED0 | LCD_SPI_ENABLE) 'CLK 8Mhz (32Mhz) by Call LCD_SPI1_Init(LCD_SPI_MODE2, LCD_SPI_MASTER_SPEED1 | LCD_SPI_ENABLE) 'CLK 2Mhz (32Mhz)

Which card should I use anyway?.
Hi D,
I updated both the IDE and Comp (why two?) 573

I took me ages to figure out which of your bits goes into OSH, but I think I got it in the end, and it doesn't work.

Is it that you use a big chip and on my PCB is SMD?
Is it that I use 'cloned' TFT ILI9341?
Is it due to capacitance?

I noticed that after trying your CODE, my CODES don't work, until I've found 'say' and old 240X240 CODE, then work up to the later ones, and I wonder if the TFT ILI9341 stores set-ups and uses them later?
Perhaps like this https://www.electro-tech-online.com/threads/display-tft-st7789-oshonsoft-basic.166219/post-1457383

I think first I'll try to address 'I's' OSC, then perhaps it will 'oil some wheels'?

As mentioned this is really hard for me, so please explain in more detail, if I am involved please?
C.
 
Last edited:
Hi D,
I updated both the IDE and Comp (why two?) 573

I took me ages to figure out which of your bits goes into OSH, but I think I got it in the end, and it doesn't work.

Is it that you use a big chip and on my PCB is SMD?
Is it that I use 'cloned' TFT ILI9341?
Is it due to capacitance?

I noticed that after trying your CODE, my CODES don't work, until I've found 'say' and old 240X240 CODE, then work up to the later ones, and I wonder if the TFT ILI9341 stores set-ups and uses them later?
Perhaps like this https://www.electro-tech-online.com/threads/display-tft-st7789-oshonsoft-basic.166219/post-1457383

I think first I'll try to address 'I's' OSC, then perhaps it will 'oil some wheels'?

As mentioned this is really hard for me, so please explain in more detail, if I am involved please?
C.
Let's go step by step:

I updated both the IDE and Comp (why two?) 573
Ok, one less thing.

I took me ages to figure out which of your bits goes into OSH, but I think I got it in the end, and it doesn't work.
-----------------

Is it that you use a big chip and on my PCB is SMD?
There is no difference.

Is it that I use 'cloned' TFT ILI9341?
There shouldn't be any difference. If the quality is worse, they may be slower.

Is it due to capacitance?
It may cause communication with the display to be slower. This may lead to having to set the SPI bus CLK speed to less than Mhz.

I noticed that after trying your CODE, my CODES don't work, until I've found 'say' and old 240X240 CODE, then work up to the later ones, and I wonder if the TFT ILI9341 stores set-ups and uses them later?
I don't think that can be.


Perhaps like this https://www.electro-tech-online.com/threads/display-tft-st7789-oshonsoft-basic.166219/post-1457383

I think first I'll try to address 'I's' OSC, then perhaps it will 'oil some wheels'?

As mentioned this is really hard for me, so please explain in more detail, if I am involved please?
I think we should start at the beginning.
 
The first thing is to establish the microcontroller used, is it the Pic18F46K20? and what card do you use?.
Hi D,
I'm using an 18F46K20 pic, fitted at the left on a PCB, I have that was developed for another project (using Nokia 5110 screens)
I posted one of these boards to Ian, and I suggested that Ian and I figure out a possible CLK issue with these PCBs (I'm not sure which clock yet?)

EDIT: I just looked at I's post and now see it is the SPI CLOCK, so I'll check my PCB :https://www.electro-tech-online.com/threads/display-tft-st7789-oshonsoft-basic.166219/post-1458363
C
 
Last edited:

Latest threads

New Articles From Microcontroller Tips

Back
Top