SPI Maximum speed

yvesbazin
Posts: 2
Joined: Tue Feb 13, 2018 12:57 pm

SPI Maximum speed

Postby yvesbazin » Tue Feb 13, 2018 1:01 pm

Dear all
I want to drive shift registers using SPI as fast as possible.
Using the native SPI pin I should be able to push data at 80Mhz
But it seems like I can't go faster than 5Mhz ?
Also changing duty_cycles doesn't have any effect.
Can someone help me
thank you

Regards
Yves

ESP_Sprite
Posts: 1758
Joined: Thu Nov 26, 2015 4:08 am

Re: SPI Maximum speed

Postby ESP_Sprite » Wed Feb 14, 2018 5:30 am

SPI is indeed perfectly capable of getting to 80MHz. It's pretty hard to find out why your implementation doesn't without knowing how exactly you set things up and measure speeds.

Xarlan
Posts: 5
Joined: Tue Jul 10, 2018 3:09 pm

Re: SPI Maximum speed

Postby Xarlan » Mon Jul 16, 2018 1:06 pm

My result:
in case use HSPI & VSPI mapped like this:
HSPI_CLK = 14 or 25 GPIO
HSPI_MOSI = 13 or 26 GPIO
HSPI_MISO = 12 or 32 GPIO
HSPI_CS = 15 or 33 GPIO

VSPI_CLK = 18 or 21 GPIO
VSPI_MOSI = 23 or 22 GPIO
VSPI_MISO = 19 or 19 GPIO
VSPI_CS = 05 or 23 GPIO

the maximum speed of CLK is 9 MHz.
photo_2018-07-16_16-01-01.jpg
HSPI
CLK = 9MHz
photo_2018-07-16_16-01-01.jpg (81.06 KiB) Viewed 223 times


However, when I use VSPI at CLK = 26MHz - it work correctly.
I connected ESP32 + 2xMAX3421E and try blik led, whic connected to MAX3421E's GPIO

Xarlan
Posts: 5
Joined: Tue Jul 10, 2018 3:09 pm

Re: SPI Maximum speed

Postby Xarlan » Tue Jul 17, 2018 10:09 am

Well
CPU Frequency - 240MHz
Flash SPI speed - 80 MHz
At this moment - maximum stable frequensy of SPI = 18MHz.
(Send command and data to MAX3421E to blink led)
Perhups, the long wire don't allow setup SPI CLK more up
photo_2018-07-17_13-04-38.jpg
photo_2018-07-17_13-04-38.jpg (62.25 KiB) Viewed 202 times

User avatar
Vader_Mester
Posts: 194
Joined: Tue Dec 05, 2017 8:28 pm
Location: Hungary
Contact:

Re: SPI Maximum speed

Postby Vader_Mester » Tue Jul 17, 2018 12:29 pm

You should thoroughly check how you set up your SPI.
It is in fact capable of 80MHz.

Although several notes: Do not use long wires in this case. Make them as short as possible.
At 80MHz long wires will distort the SPI clock a lot, and impedance.

So when you measure the SPI clock, measure it as close to the GPIO pin as possible.
There are 2 types of programmer people: The Expert programmer and The Smart programmer

The Expert programmer easily writes any code from scratch.
The Smart programmer uses his google/github powers first ;)

Who is online

Users browsing this forum: 0xffff, Bing [Bot], Pcborges and 3 guests