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: 217
  • ST7789_240X240.bas
    15 KB · Views: 189
  • _SPI_Library.bas
    6 KB · Views: 200
  • _Pic18F26K22Library.bas
    46.4 KB · Views: 188
  • _SetUpAmicus18.bas
    2.9 KB · Views: 180
I don't understand you.
Connect the RS232 port of the card to the PC either directly if it has the appropriate connector or if it doesn't, use an RS232 to USB adapter, start a serial console, configure it with the appropriate com port and the speed of 115200.

I use this one:
 
Last edited:
I don't understand you.
Hi D,
See attached.
C
ICSP.jpg



Connect the RS232 port of the card to the PC either directly if it has the appropriate connector or if it doesn't, use an RS232 to USB adapter, start a serial console, configure it with the appropriate com port and the speed of 115200.

I use this one:
 
Is there any way to see the layout of your card?.

Changing the subject, let's forget about the RS232 serial port.
If we make a program that generates a certain frequency on a pin, can you measure it?.
 
Last edited:
Is there any way to see the layout of your card?.
Hi D,
I'm interested to know what you mean by card?
I'm programming a PIC on a PCB using the 5x PINs shown just above the screen ribbon cable, using I.C.S.P. and a Pickit3.

I have FTDI serial adaptors but they have USB feed and TX and RX PINS for DATA, that I read using a terminal.
I don't have anything with the 'D' socket as shown in your device.
C
 
Hi D,
I'm interested to know what you mean by card?
I'm programming a PIC on a PCB using the 5x PINs shown just above the screen ribbon cable, using I.C.S.P. and a Pickit3.

I have FTDI serial adaptors but they have USB feed and TX and RX PINS for DATA, that I read using a terminal.
I don't have anything with the 'D' socket as shown in your device.
C
From now on I won't say card, I'll say PCB.
So yes, you can connect your PCB to the PC via serial (UART). I don't care if you do it with the old DB9 (RS232 to USB) or USB to USB connector.

So now we understand each other, try downloading the above .hex (#292) to your microcontroller and check that the communication with the PC is correct.
 
From now on I won't say card, I'll say PCB.
So yes, you can connect your PCB to the PC via serial (UART). I don't care if you do it with the old DB9 (RS232 to USB) or USB to USB connector.

So now we understand each other, try downloading the above .hex (#292) to your microcontroller and check that the communication with the PC is correct.
Hi D,
Have you ever used a programmer such as Pickit and the in circuit programming connections?
C.
 

Attachments

  • Check connection.jpg
    Check connection.jpg
    199.8 KB · Views: 7
Yes I use it, but I don't understand what it has to do with the topic.
Hi D,
I'm confused too!
From my understanding, you want me to test the HEX CODE at #292, by programming the PIC, using the UART, and I don't know the difference between programming with UART or Pickit?

I tried programming with Pickit, but no result, and I have never programmed using UART, so if it is different, how do I do it? And what should I expect to happen?
C
 
Last edited:
I can get a pic.. I will get one next time I order from RS..

Do you have another board you can test? Leave off the pic18f4431 and watch the SCL.. at the moment I do not get proper switching ... Here is the clock at 4Mhz

View attachment 148036

Look at the data signal (bottom) rise and fall more than half the clock.. This is either the chip itself or stray capacitance... Now both these signals are on the same port.. I also see the peak to peak IS 3,3v so we are getting neg to pos... I wonder if there is a slew issue here.. let me divulge the datasheet see it there is a setting.. I do not use the 3v3 devices..
Hi I,
I was looking closer into the SPI Clock, CKE and CKP, to double check what the ST7789 actually needs.

I came across this:

Which has a similarity to your OSC readings.
NOTE: the at rest settings appear different.
C
 

Attachments

  • BIT1.jpg
    BIT1.jpg
    162.5 KB · Views: 9
I'm sorry, but I don't know how to interpret waveforms, that's why I didn't answer you before. My oscilloscope has a SPI decoder and it samples the values of the bytes on the screen that pass through the bus. So I don't need to know how to interpret waveforms, which is a very complicated matter.
 
I'm sorry, but I don't know how to interpret waveforms, that's why I didn't answer you before. My oscilloscope has a SPI decoder and it samples the values of the bytes on the screen that pass through the bus. So I don't need to know how to interpret waveforms, which is a very complicated matter.
Hi D,
You may have noticed that I always address each reply to the a particular person for clarity (I just use their initial for amusement)
In this case I was replying to Ian from the post of his Oscilloscope.

If you look at both images you may notice, that the two signals aren't lined up. This has the result that the first BIT of the message has been missed.
If you look at my posts: https://www.electro-tech-online.com/threads/display-tft-st7789-oshonsoft-basic.166219/post-1458411
this was done with a digital analyser, which are not expensive and very useful, in indicating problems.
In these analyser images you can see arrows on the CLK sisgnal, this is when the DATA is passed.
This depends on the SPI settings, and this is what I'm trying to clarify.
C
 
Last edited:
AH! When diagnosing the clock simply send 0xff as data and sync to it.. then you can observe the clock pulse and, more importantly, the slew. As you see the 4Mhz will work, but any faster and the clock will diminish..
 
If I’m not mistaken, Camerart operates with a 32 MHz clock, which allows the SPI bus to be configured at 8 MHz, 2 MHz, and 0.5 MHz. If there is an issue caused by parasitic capacitance, it will be significantly reduced by lowering the speed to 0.5 MHz.
 

New Articles From Microcontroller Tips

Back
Top