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: 172
  • ST7789_240X240.bas
    15 KB · Views: 156
  • _SPI_Library.bas
    6 KB · Views: 165
  • _Pic18F26K22Library.bas
    46.4 KB · Views: 155
  • _SetUpAmicus18.bas
    2.9 KB · Views: 145
Hi D and I,
Thanks.
With both of your CODEs I have to alter them to make them work.
e,g, there is no SSP1CON1 with the 18F46K20, and they don't oscillate, so I use my XTL oscillator.
Ian's is almost working, but I can't change some of the settings, e,g, sreen writing direction.

Using my set up with DOG's CODE, it compiles, but the [ Proc LCD_init() ] section stops my LED and SCREEN indicator working, maybe the oscillator?.

I don't expect either of you to mess about with my CODE, so you can devolop the TFT without needing to get held up by me. I'm afraid this is due to the limit of my programming skills. {tiresome!}

Do either of you mind me posting your CODE on the AAC forum?
C
 
Last edited:
Hi C.

That may be a typo on Dogs code as I use SSPCON1 and always have.

Post me your current code. I'll see what gives..

Which code do you want on AAC?
 
I use the Pic18F46K22 which has two MSSP modules, and I have the habit of configuring the registers with the names of the datasheet. In my case it would be SSP1CON1, to make it compatible you just have to delete the "1" in the middle of the registers, this register would be SSPCON1 for your Pic. However, the 18F46K22 for the MSSP1 accepts both, so I will edit it and change it because it works for me in both ways.

I think that to publish the libraries in another forum we would first have to finish the final ones, but for my part there is no problem.
 
Hi D,
I went through your CODE and changed the SSP1CON1 toSSPCON1. They look the same in both D/S.
As mentioned your CODE stops due to the LCD_INIT.
Well done with the commenting, it helps a lot.
C.
 
Hi C.

Post me your current code. I'll see what gives..

Which code do you want on AAC?
Hi I and D,
I'll post the CODE later, but it is set up to use my PCB which has a crystal controlling the osc.
Earlier I offered that I post you one of my PCBs (Also you D) no problem if you prefer your electronics.

I hoped to use your CODE body, within my set up, which is working and I can change some of the settings, but not MADCTL.
C.
 
Hi C,

If the program stops at LCD init, then the I2C is struggling...

Run the I2C at 4Mhz until you get the thing sorted Mine is at 8Mhz so just increase the speed by 1

ie instead of SSPCON1 = 0x30 use SSPCON1 = 0x31
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…