Hardware SPI Problem

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
TRMrNo
Posts: 15
Joined: Fri May 28, 2021 9:24 pm

Hardware SPI Problem

Post by TRMrNo » Sun Jul 17, 2022 12:50 pm

Hello,
I am trying to use st7789 LCD Display. I am using 14, 13 and 12 pins as hardware SPI interface but it is not working. When I use the same pins as SoftSPI it works properly. What Could be the problem ?

working

Code: Select all

spi = SPI(-1,baudrate=30000000, polarity=1, phase=0, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
not working

Code: Select all

spi = SPI(1,baudrate=30000000, polarity=1, phase=0, sck=Pin(14), mosi=Pin(13), miso=Pin(12))

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Hardware SPI Problem

Post by jimmo » Mon Jul 18, 2022 3:23 am

Which board/port are you using?

Have you tried using a lower baudrate with the hardware SPI? (My guess is that the softspi isn't really running at 3Mb)

TRMrNo
Posts: 15
Joined: Fri May 28, 2021 9:24 pm

Re: Hardware SPI Problem

Post by TRMrNo » Mon Jul 18, 2022 6:15 pm

hello @jimmo I forgot to write the board. I am using ESP32-CAM module. SoftSPI is not resolving my problem. I need to run the Hardware SPI mode. I tried lower baudrates in Hardware mode but it did not worked.

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: Hardware SPI Problem

Post by jimmo » Tue Jul 19, 2022 1:57 am

TRMrNo wrote:
Mon Jul 18, 2022 6:15 pm
hello @jimmo I forgot to write the board. I am using ESP32-CAM module. SoftSPI is not resolving my problem. I need to run the Hardware SPI mode. I tried lower baudrates in Hardware mode but it did not worked.
Sorry I don't follow -- are you saying that neither modes work? Or are there two different things going on here, one with the display, one with the camera?

TRMrNo
Posts: 15
Joined: Fri May 28, 2021 9:24 pm

Re: Hardware SPI Problem

Post by TRMrNo » Wed Jul 20, 2022 11:43 am

Hello @jimmo

Actually my problem is Hardware SPI. It is not working in fast or slow mode that I even tried in 100KHz. Besides, SoftSPI works as expected.

I can stream camera data to LCD display but due to harware SPI problem it is too slow.

User avatar
russ_h
Posts: 88
Joined: Thu Oct 03, 2019 2:26 am
Contact:

Re: Hardware SPI Problem

Post by russ_h » Wed Jul 20, 2022 11:04 pm

I have not spent much time with the ESP32-CAM board, but the schematics show the SDCARD using pins 12, 13, and 14 (and others) for the SDMMC interface. Could that be causing issues with the hardware SPI?

TRMrNo
Posts: 15
Joined: Fri May 28, 2021 9:24 pm

Re: Hardware SPI Problem

Post by TRMrNo » Thu Jul 21, 2022 9:14 pm

I think that sharing the same pins with the SD card should not be problem. There should be another problem.

Post Reply