Need st7789 help. #4983
Replies: 9 comments 3 replies
-
I'm just guessing here, but comparing your code to mine, that is working fine with
LCD_RST.Configure(machine.PinConfig{Mode: machine.PinOutput})
LCD_DC.Configure(machine.PinConfig{Mode: machine.PinOutput})
SPI_CS.Configure(machine.PinConfig{Mode: machine.PinOutput})
LCD_BL.Configure(machine.PinConfig{Mode: machine.PinOutput})
Otherwise your code looks good and should go pass the configuration step if there are no mechanical issues. |
Beta Was this translation helpful? Give feedback.
-
Can you try FWIW, you can clone |
Beta Was this translation helpful? Give feedback.
-
Update and new question: I've found a couple of st7789 drivers written in C so my projects can move forward. In an effort to find out why I can't get the tineygo st7789 driver working I was going to use, as suggested here, gdb. So I tried this which didn't work. Main.go is the file above.
|
Beta Was this translation helpful? Give feedback.
-
If you can get a C driver to work with TinyGo, I guess it's more productive to port that driver, or diff the Go and C driver to see what they're doing differently. |
Beta Was this translation helpful? Give feedback.
-
Well I got as far as running a local copy of the driver. It was immediately clear that the first time sendCommand() is called it hangs on: |
Beta Was this translation helpful? Give feedback.
-
I don't have this board = Waveshare PicoLCD 1.14. But I have an oscilloscope and a cheap logic analyzer. Using only the scope I was able to do several tests including this one, but only measuring the GPIO ports.I don't have the ST7899 display module yet. I think I've discovered the problem that's preventing your program from running correctly. ![]() This is the program I ran, and it appears to be correct. Please test it and let us know the results.
|
Beta Was this translation helpful? Give feedback.
-
Right now my main.go looks like yours. One of the issues I had with Pico-1.14 display is that the display reset is connected to GP12 which machine.SPI thinks is a great candidate for the SDI pin and machine.SPI will not allow you to change it. Configuring it later as a reset pin seems to enable the display bit it just shows a black rectangle on a background of color noise. The rectangle comes from the After that the display doesn't respond to any input and appears to be frozen. I'm running the driver locally and it runs fine but the display just sits there with its black rectangle. My guess right now is that the st7789 buffer is 320x240 and setWindow(), in the driver has a problem with the displays 240x135 width and height. Somewhere in the data being TXed to the st7789. I've got the Driver loaded with println() statements but I haven't nailed down the problem. BTW I get the same results from the driver at tinygo/x/drivers so it's not a local issue. I work on this as time allows but since it doesn't work its not a high priority. Still it would be nice to see progress. I'll have another go tonight. Thanks for taking the time to look at this! |
Beta Was this translation helpful? Give feedback.
-
I don't think the RESET pin is causing any problems. But if you notice that RESET is interfering with functionality, you can try creating a dedicated reset procedure. I recommend you do this test (changing to SPI1 config and other pins): Please test it and let us know the results. |
Beta Was this translation helpful? Give feedback.
-
Thanks.
Changing the width, height and the display has colors but is corrupt. I f found an stt7789 driver that handles 320,240, 240x240, and 240x135 resolutions. I'll attempt to port it over to Tinygo in the next few nights. I've also ordered a waveshare 240x240 lcd. Should be here in tomorrow for some more testing. Onward and upward... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Waveshare PicoLCD 1.14 which I'm trying to get working with an rpi pico or pico2. Both behave the same way. My code gets to the Config sections and blocks never to return.
``
package main
import (
"image/color"
)
// Define your specific pin assignments here
const (
SPI_SCK = machine.GP10 // clock
SPI_SDO = machine.GP11 // data
SPI_CS = machine.GP9 // select
LCD_DC = machine.GP8 // data/command
LCD_RST = machine.GP12 // reset
LCD_BL = machine.GP13 // lcd backlight
)
var display st7789.Device
func main() {
}
``
Any help would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions