Full-duplex SPI with cs_ena_pretrans

DurandA
Posts: 17
Joined: Thu Nov 26, 2015 11:51 pm

Full-duplex SPI with cs_ena_pretrans

Postby DurandA » Mon Apr 27, 2020 11:01 am

Hi!

According to ESP-IDF documentation, using cs_ena_pretrans (https://docs.espressif.com/projects/esp ... _pretransE) only works on half-duplex transactions.

However, my device works in full-duplex and requires a 100 ns CS setup time ((5) from the diagram below).
timing.png
timing.png (15.75 KiB) Viewed 3357 times
timing2.png
timing2.png (23.37 KiB) Viewed 3357 times
Is this a hardware limitation or does it comes from the ESP-IDF implementation? Is there a trick to use full-duplex anyway? Should I bitbang CS?

DurandA
Posts: 17
Joined: Thu Nov 26, 2015 11:51 pm

Re: Full-duplex SPI with cs_ena_pretrans

Postby DurandA » Wed May 06, 2020 4:00 pm

Digging a bit, I found a comment on this https://github.com/espressif/esp-idf/bl ... #L323-L324:
The hardware looks like it would support this, but actually setting cs_ena_pretrans when transferring in full duplex mode does absolutely nothing on the ESP32.
If I interpret it correctly, that means that the ESP32 just ignore the cs_ena_pretrans in full duplex mode. Is it worthwhile to characterize it with different values or is cs_ena_pretrans just always ignored?

More interesting, this is checked in a #ifdef CONFIG_IDF_TARGET_ESP32 barrier. Does it mean that this limitation does not apply to the ESP32-S2?

Who is online

Users browsing this forum: No registered users and 89 guests