PyPortal (Titano): SPI (instead of I2C)

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
pkorney
 
Posts: 3
Joined: Mon Nov 22, 2021 11:42 am

PyPortal (Titano): SPI (instead of I2C)

Post by pkorney »

Hi!
Hopefully this is the correct forum for my question.
I have a PyPortal Titano and was thinking that it would be an excellent UI platform for a machine control task I have in mind. However, the machine control uses SPI not I2C.
In researching this problem a little, I ran across your article "Using ATSAMD21 SERCOM for more SPI, I2C and Serial ports" and wondered whether a similar approach with CircuitPython on the PyPortal would be possible. Seems like a cleaner, more direct solution than constructing some sort of front-end translator or just bit-banging to make it work.
Ideally, the D3 and D4 on the PyPortal would be sufficient for one SPI with 3 bits of CS which would be enough for my initial needs.
I am nearly a beginner with embedded systems so I could have easily missed a better/simpler/obvious way to accomplish this with the PyPortal.
Thanks for any help/guidance you can provide!!

User avatar
dastels
 
Posts: 15660
Joined: Tue Oct 20, 2015 3:22 pm

Re: PyPortal (Titano): SPI (instead of I2C)

Post by dastels »

It'll be a hassle at the very least to use a PyPortal with a SPI interface. The external connections are the worst of it. My choice would be to use a Feather (M4 Express likely) and a Featherwing display, e.g. https://www.adafruit.com/product/3651 which would allow you to easily connect to the SPI signals. If you need the WiFi capabilities you should be able to add an AirLift board (either breakout or Featherwing. You'd have to verify hat you could do the wing version without pin/signal conflicts.

Dave

User avatar
pkorney
 
Posts: 3
Joined: Mon Nov 22, 2021 11:42 am

Re: PyPortal (Titano): SPI (instead of I2C)

Post by pkorney »

Hi Dave,
Thanks for the quick reply! Glad I didn't spend too much time stubbornly trying to work out how to do this.
Also I realized that given the physical distances involved (a few feet), chip-to-chip protocols aren't ideal, especially in an electrically noisy environment.
Thanks again for the assist!!

User avatar
dastels
 
Posts: 15660
Joined: Tue Oct 20, 2015 3:22 pm

Re: PyPortal (Titano): SPI (instead of I2C)

Post by dastels »

Yeah, SPI might be tricky over that distance. I wonder if active termination would help. See https://www.adafruit.com/product/4756 for an approach to long distance I2C. There's this app-note/white-paper by TI that addresses the issue: https://www.ti.com/lit/an/slyt441/slyt441.pdf.

Dave

User avatar
pkorney
 
Posts: 3
Joined: Mon Nov 22, 2021 11:42 am

Re: PyPortal (Titano): SPI (instead of I2C)

Post by pkorney »

Dave,
Thanks for the great info and help! Wow! Doesn't get much simpler than using this Active Terminator to extend I2C.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”