Breazile / MandoPuter

Electronics to drive a Mandalorian gauntlet
MIT License
41 stars 9 forks source link

I have trouble conecting the LCD #14

Closed AriadnaDRA closed 1 year ago

AriadnaDRA commented 1 year ago

Hello, I'm trying to do the Mando Puter for the beskar guantlet, but i didn't find the same display that the one show in this github.

i'm working with Adafruit Feather M4 Expres and a random LCD image image image and I'm not sure how to connect the different ports. IDK if it is possible to do it with this screen...

Thanks

Breazile commented 1 year ago

If that display works with 3.3 volts (rather than 5v) then it should work in the beskar configuration. Select the 1.3" LCD in the configuration and wiring should be the same as this:

https://github.com/Breazile/MandoPuter/blob/master/Images/FeatherM4ExpressBeskarWiring.jpg

Breazile commented 1 year ago

BLK pin should be the same as LITE RES same as RST SCL same as SCK SDA same as SI

AriadnaDRA commented 1 year ago

Thanks! i will try

AriadnaDRA commented 1 year ago

I tested and it seams to respond but im not able to discover why it dosent show anything, its conected via and android cabel to the PC idk if they need more voltatge

WhatsApp Image 2023-07-10 at 8 21 25 PM

I check all the cables with a tester and all are okey

https://github.com/Breazile/MandoPuter/assets/133783611/47c925f3-96f9-4cfc-a789-26759435e89a

https://github.com/Breazile/MandoPuter/assets/133783611/b36328bd-f368-4fe2-94f4-9e0ea04434fc

Breazile commented 1 year ago

I can see there is a code error by the flashing LED. Can you send me the code.py that you are using as well as the file called boot_out.txt that should be on the Feather? That will show me which version of CircuitPython is installed on the board as well as the selections in code,py.

AriadnaDRA commented 1 year ago

The boot_out is this:

Adafruit CircuitPython 8.2.0 on 2023-07-05; Adafruit Feather M4 Express with samd51j19 Board ID:feather_m4_express UID:A8F7D68E32433753202020310E180FFF

And the code.py is the same has the download via https://github.com/Breazile/MandoPuter/blob/master/Releases/ESP32-S3Beskar.zip

""" MandoPuter will display text in a Mandalorian font on a tiny LCD display

File - code.py Author - Jon Breazile

https://github.com/Breazile/MandoPuter

Font credits to ErikStormtrooper, the bitmap fonts were created from his TrueType font http://www.erikstormtrooper.com/mandalorian.htm """ import gc import time import alarm import board import busio import pwmio import neopixel import digitalio import displayio import adafruit_dotstar as dotstar import adafruit_imageload from analogio import AnalogIn from adafruit_display_text import label from adafruit_bitmap_font import bitmap_font from adafruit_st7789 import ST7789 from adafruit_lc709203f import LC709203F

""" ----------- User configurable items -----------

This is where you can customize your display and hardware setup. Select either the Pre-Beskar (1.14" LCD) or Beskar (1.3" LCD) display. Some lines are commented out which means the line is not active. A commented line starts with a #

"""

Set the display type

DISPLAY = "Pre-Beskar" # Adafruit 1.14" LCD display https://www.adafruit.com/product/4383

DISPLAY = "Beskar" # Adafruit 1.3" LCD display https://www.adafruit.com/product/4313 DISP_BRIGHT = 80 # How bright to make the display - 0% to 100%

Board being used

BOARD_TYPE = "ESP32-S3" # ESP32-S3 https://www.adafruit.com/product/5477

BOARD_TYPE = "FeatherM4" # Feather M4 Express https://www.adafruit.com/product/3857

BOARD_TYPE = "ItsyBitsyM4" # ItsyBitsy M4 Express https://www.adafruit.com/product/3800

BOARD_TYPE = "ItsyBitsyRP2040" # ItsyBitsy RP2040 https://www.adafruit.com/product/4888

BOARD_TYPE = "PiPicoRP2040" # Raspberry Pi Pico RP2040 https://www.adafruit.com/product/4864

Mandalorian charater sequence that is shown on the display

messages = [ "MLM", "JBM", "SAS", "JAS", "JBM", "MLM", "SAS", "AJS", "SAS"]

Time that each character group is shown 0.50 is 500 milliseconds, or 1/2 of a second

delays = [ 0.75, 0.75, 0.650, 0.75, 0.50, 0.84, 1.00, 0.35, 0.84] TEXT_COLOR = 0xFF0000 # Red on black (you can chose colors here - https://www.color-hex.com/)

. . .

AriadnaDRA commented 1 year ago

I just saw that the version is the 8.2 and in the install section you say that these files were tested with CircuitPython 8.0.0-beta.6, I put the 8.0.0 version but is still the same image

Breazile commented 1 year ago

Looks like you downloaded the wrong zip file (esp32). You need the zip for the feather m4 express.

https://github.com/Breazile/MandoPuter/blob/master/Releases/FeatherM4Beskar.zip

AriadnaDRA commented 1 year ago

Sorry I put the wrong link, but the files are the correct ones, i just download and put in the feather again to be sure.

image

Breazile commented 1 year ago

Can you send me a screen shot of what the contents of your circuitpy volume looks like? Just want to see what files are there

Breazile commented 1 year ago

It should look similar to this:

image
AriadnaDRA commented 1 year ago

i have this image

AriadnaDRA commented 1 year ago

it's all the files from : https://github.com/Breazile/MandoPuter/blob/master/Releases/FeatherM4Beskar.zip

All are almost the same but you have some files .wav that i don't have.

I'm trying to see the error and why im in safe mode, i follow this https://learn.adafruit.com/welcome-to-circuitpython/advanced-serial-console-on-windows and install PuTTY but in the plooter all i can see i this image it says that code is done running but i didn't see anything in the LCD

AriadnaDRA commented 1 year ago

Sorry for being a pain in the ass, but it's frustrating me a little bit, I've continued investigating and I can't find anything else, and when I try the PuTTY again I only get a black screen and I don't understand anything TT

image

Breazile commented 1 year ago

Been busy at work and headed out tomorrow to go camping. Things look right, so I'm going to try it on my board with Circuitpython 8.2.

In the meantime, you can try installing the Mu editor and load the code.py from your board while it is plugged in? If you click on the serial icon, it should spit out some error message at the bottom when it hits a problem. That would pinpoint where things are going wrong in the code. Details on installing Mu are here:

https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor

Breazile commented 1 year ago

OK, I loaded CircuitPython 8.2 to my feather board. Then I erased all of the files from the circuitpy drive and copied over the contents of the ZIP file. It's running fine. You might try removing all files and copying again. If that fails then I think we need to look at the wiring

Breazile commented 1 year ago

Looking at your display it has no chip select pin like the other displays. Not clear if that is even needed, but one difference. I'm looking at the documentation to see if there are any code changes needed.

You can try changing the bit speed back to the default and see if that helps. This line here in config.py:

SPI_SPEED = 48000000 # How fast the SPI bus to the LCD operates

Change the 48 to 24 and keep all of the zeros

AriadnaDRA commented 1 year ago

I installed the MU editor and change all you say, and now it says that i havent modules image

AriadnaDRA commented 1 year ago

I copy again the libraries carpet and now it seams to be caught in the output image

I check the program and as you said I don't have the tcs port conected to anithing. in the code we have this lines it can be something with this?

tft_cs = board.D6

display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, baudrate=SPI_SPEED, reset=lcd_rst, polarity=0, phase=0)

Breazile commented 1 year ago

I looked and the API only supports 4 wires (not 3). Not sure if that is a problem, especially if the wire is just an output to the display. I tried searching for the display specs but could not find it. I'm going camping, back on Wednesday. If I think of anything else to try I'll let you know. One thing you can do is turn on the debug LED. It should be purple if the code is running correctly

ENABLE_LEDS = 0 # Set to 1 to turn on LEDs for debugging, set to 0 to save battery

Change the 0 to 1

AriadnaDRA commented 1 year ago

Sorry for the delay but Im in a work trip and i forget the cable at home :')

I finally get one and i try the led and it shows in purple! WhatsApp Image 2023-07-18 at 6 23 35 PM

Breazile commented 1 year ago

OK, so the code is running which narrows things down a bit. Try setting the SPI_SPEED down to 24000000:

SPI_SPEED = 48000000 # How fast the SPI bus to the LCD operates

Just change the 48 to a 24.

Another thing you can try is the phase and polarity settings (try changes one at a time):

display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs, baudrate=SPI_SPEED, reset=lcd_rst, polarity=0, phase=0)

On the line above try changing the polarity to 1, and phase to 1. There are 3 combinations to try:

polarity = 1, phase = 0 polarity = 0, phase = 1 polarity = 1, phase = 1

I would keep the SPI_SPEED at 24000000 when trying those since that is the default speed and it won't make a difference.

AriadnaDRA commented 1 year ago

OMG it works!!!

https://github.com/Breazile/MandoPuter/assets/133783611/43189b67-18a4-434f-b3f5-77dfa8abaa52

Thanks for all!! you are the best!

Breazile commented 1 year ago

Glad we finally got it working