Postby rsimpsonbusa » Fri Aug 03, 2018 1:27 am
Hi ESP_Sprite.
Had the SPI driver in Half Duplex since 1 year or more ago due to the, at that time, "unknown reason" for read corruption. Now read the new 3.0 Docs and it "kinda" tells the reason for the apparent read error, MISO delay.
Now I have the SPI device in IOMUX pins, and tested it with a 40MHZ clock rate, half duplex and works fine, but half duplex and most importantly, NO DMA.
When using 8MHZ(for tests purposes) Full Duplex and just testing 1 command to the FRAM (getdeviceID 0x9F), it again fails when reading just 4 bytes. This is 8 more bits than that magic number 32 bits so much mentioned in the SPI driver. Tried a lot of things and always misses the 4th byte and at a very low speed.
Logic analyzer shows clearly that the FRAM is returning the correct data 0x047F 0x2703 but the esp32 always gets the last byte wrong, no matter what is done, 047F (correct) and 2742 (wrong its 2703 hex).
The Transaction block had 40 total bits and 32 rx_length giving 8 bits to transmit. BTW I guess this is the "math" the driver uses how calculate bits to transmit and how many to receive, since there is no explicit tx_length parameter (is this right?). Total bits - rx_length= "tx_length". Not awfully well explained and no example for reading SPI, just for writing. Should be explained a little more for us dummies.
The value for me is not the full duplex, seldom will a device really use full duplex, but not being able to use the DMA is a loss for the CPU that has to handle the mem-device exchange getting a busy CPU that may not be able to handle another load.
Any ideas?
Thanks.
-
Attachments
-
- Screen Shot 2018-08-02 at 12.42.23 PM.png (145.49 KiB) Viewed 7371 times
-
- Screen Shot 2018-08-02 at 12.42.02 PM.png (35.5 KiB) Viewed 7371 times