adafruit / Adafruit_DotStar

GNU General Public License v3.0
98 stars 58 forks source link

Hardware SPI - Chip Select #19

Closed yngndrw closed 2 years ago

yngndrw commented 7 years ago

What is the recommended way of using Dot Stars when there's something else that's also using SPI, for example an SD card ?

I'm thinking that if you're using a level shifter (E.g: 74AHCT125), you could use the output enable level shifter pin on the clock line to act as a chip select for the Dot Stars, and simple set it before every call to the Dot Star "show" method. Thoughts ?

yngndrw commented 7 years ago

I've just found that you can use SERCOM modules to create additional SPI ports, which is a perfect solution for this: https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports/creating-a-new-spi

The issue however, is that this library relies on the pre-defined SPI object which uses sercom4, and there's no way to override what it's using. The same also applies to the SD card library where you can only set the SS / Chip Select pin. Any ideas on how this issue can be resolved ?

yngndrw commented 7 years ago

See PR #20

caternuson commented 2 years ago

What is the recommended way of using Dot Stars when there's something else that's also using SPI, for example an SD card ?

The recommendation is to have only DotStars on whatever SPI peripheral is being used. Other "regular" SPI devices will need to use a separate SPI peripheral. Software SPI is supported, so if HW SPI's are limited, can revert to that.

septatrix commented 2 years ago

It should also be possible to put a mosfet or similar on the clock line to prevent the data from reaching the leds