|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
SPI Write Limitation
Hi All,
I've been working with some adafruit DotStar LED strands, driving them with the RIO's onboard SPI (using Java). I have them working, but to do so required I chunk the data to send into 128-byte sections, and call the spi.write() multiple times (once per section). This was done because the maximum return value I ever saw spi.write() give was 128. I'm not horribly experienced with SPI - is this an implicit limitation of SPI in general? Or of the libraries and hardware we're using for FRC? Perhaps also I forgot to set up some buffer properly. Has anyone else seen this? EDIT: Here's the code in question DotStarsLEDStrip.java Last edited by gerthworm : 08-02-2016 at 08:26. |
|
#2
|
||||||
|
||||||
|
Re: SPI Write Limitation
It looks like the limitation is in wpilib, rather then the roboRIO.
|
|
#3
|
||||
|
||||
|
Re: SPI Write Limitation
Seems like it. The bit of research I've done on this seems to indicate SPI is implemented on the FPGA, which I assume means any buffers are of fixed length. What those lengths are, however, I'm not really sure....
|
|
#4
|
|||
|
|||
|
Re: SPI Write Limitation
Quote:
[1] http://www.xilinx.com/support/docume...q-7000-TRM.pdf, section 17.2.4. |
|
#5
|
||||
|
||||
|
Re: SPI Write Limitation
We are trying to control the AdaFruit DotStars through the SPI bus, too, except we are using LabVIEW. Which ports on the roboRIO did you guys connect the dotstar to?
|
|
#6
|
||||
|
||||
|
Re: SPI Write Limitation
Actually, we ended up using both at one point. We started by using the dedicated 10-pin port on the top, then we switched to the port that's on the custom expansion port in the middle.
I'm not familiar with sending bytes in labview. However, I know in java it was just a single initialization parameter to say which SPI port to use. Everything else was the same. Also as indicated in this thread, we did have to chunk the send data into 128-length bytes to get it to work nicely. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|