Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Blinka Question (Please help): Using FT232H USB to SPI to Dr
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Blinka Question (Please help): Using FT232H USB to SPI to Dr

by mtolfa on Tue Apr 21, 2020 9:35 pm

Hello, I've been stuck on this issue for a while now, really hoping someone can point me in the right direction!!!

I would like to drive SPI-controlled LEDs via USB. I have purchased the Adafruit FT232H breakout board, along with these LEDs: https://www.pololu.com/product/3087

I was very successful controlling them via the SPI bus on a Raspberry Pi, however when I try to use the Adafruit board along with Blinka code from my Linux PC, it's not working. The lights are lighting up but not in a predictable or controllable way. Something must be wrong with the communication, but the bytes being sent have been tested.

Any thoughts? Shouldn't this be possible?

Also - is it possible to configure the breakout board to always be in spi mode so when it's plugged in it pops up as a device and you can use spidev directly? i.e. /dev/spi*

some of my code...

import board
import adafruit_dotstar as dotstar

#Using a DotStar Digital LED Strip with 60 LEDs connected to hardware SPI
dots = dotstar.DotStar(board.SCK, board.MOSI, 2, brightness=0.2)

mtolfa
 
Posts: 4
Joined: Wed Apr 15, 2020 2:07 pm

Re: Blinka Question (Please help): Using FT232H USB to SPI t

by mtolfa on Tue Apr 21, 2020 10:08 pm

Also, this may not be an issue but just in case; this is what happens when I ask for available ftdi interfaces (see attached)
Attachments
Screenshot from 2020-04-21 19-04-28.png
Screenshot from 2020-04-21 19-04-28.png (12.58 KiB) Viewed 48 times

mtolfa
 
Posts: 4
Joined: Wed Apr 15, 2020 2:07 pm

Re: Blinka Question (Please help): Using FT232H USB to SPI t

by adafruit_support_carter on Thu Apr 23, 2020 4:42 pm

In general, this should work. Make sure the board isn't set to I2C mode via the switch on top (set it to OFF).

I did a quick test using 3V for power and was able to light the first 5 DotStars OK. But keep in mind that DotStars are 5V and so working at 3V isn't guaranteed. See guide for info on using a level shifter:
https://learn.adafruit.com/adafruit-dot ... ep-3004526

Code: Select all | TOGGLE FULL SIZE
$ export BLINKA_FT232H=1
$ python3
Python 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import adafruit_dotstar
>>> dots = adafruit_dotstar.DotStar(board.SCK, board.MOSI, 5)
>>> dots.fill(0xff0000)
>>>

ft232h_dotstar.jpg
ft232h_dotstar.jpg (315.81 KiB) Viewed 36 times

adafruit_support_carter
 
Posts: 15961
Joined: Tue Nov 29, 2016 2:45 pm

Re: Blinka Question (Please help): Using FT232H USB to SPI t

by mtolfa on Fri Apr 24, 2020 12:50 pm

Thanks for your reply - I can look into that. But doesn't the Raspberry Pi use 3V logic? It worked perfectly fine from the SPI bus on the pi

mtolfa
 
Posts: 4
Joined: Wed Apr 15, 2020 2:07 pm

Re: Blinka Question (Please help): Using FT232H USB to SPI t

by adafruit_support_carter on Fri Apr 24, 2020 4:56 pm

Yep, PI is 3V logic. It might work for you. Just have to try and find out. Slight variances in the power can really make a difference.

adafruit_support_carter
 
Posts: 15961
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.