HSPI chip select

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
__deets__
Posts: 21
Joined: Sun Aug 20, 2017 4:50 pm

HSPI chip select

Post by __deets__ » Sun Aug 20, 2017 4:53 pm

Hi,

I searched the board an the source for uP ESP2866 edition, but didn't find anything related to this.

According to the documentation of my ESP2866 12E, GPIO15 should be SPI 1 chip select.

However it does not toggle when I transfer data (as verified by my scope). MOSI and CLK work just fine.

The driver source seems to be here:

https://github.com/micropython/micropyt ... spi.c#L100

The comment is a bit cryptic for me to understand. So I guess the bottom line is: can the hardware CS be activated, or do I have to emulate it myself?

torwag
Posts: 220
Joined: Fri Dec 13, 2013 9:25 am

Re: HSPI chip select

Post by torwag » Sun Aug 20, 2017 7:29 pm

Hi,
maybe you find more answers looking for the Esp8266 instead of the ESP2866 ;)
But yes, as far as I can tell (never used SPI with micropython) CS is not implemented by the generic SPI driver. However, as it is a simple io action, one can simply create a Pin instance to do the job and wrap this into a function together with the original SPI read and write.

__deets__
Posts: 21
Joined: Sun Aug 20, 2017 4:50 pm

Re: HSPI chip select

Post by __deets__ » Sun Aug 20, 2017 7:37 pm

I ALWAYS flip the numbers :oops:

I'm not sure how the SPI driver works. If I'm synchronous your approach is fine. If it's IRQ driven, the real CS would allow to spawn a transfer while e.g. serving a timer callback.

Is that known?

Post Reply