![]() |
RoboRIO SPI Configuration
Previously WPILib provided support for configuring the bits per word for SPI. Does anyone know how to do that for the RoboRIO built-in SPI?
|
Re: RoboRIO SPI Configuration
I'm having the same problem. The SPI code that worked on our CRios wont work on the RoboRio because of this.
|
Re: RoboRIO SPI Configuration
I found a solution. You can use the Linux spidev. It is the standard SPI interface for Linux microcomputers. With it you can set all the low level SPI settings including the bits per word. Documentation can be found here https://www.kernel.org/doc/Documentation/spi/spidev.
This is the code I use to enable the spi port: Code:
/******************************************************************************Code:
const char *device = "/dev/spidev0.X"; //for the main SPI port with chip select XCode:
//SPI interfaceCode:
/********************************************************************** |
Re: RoboRIO SPI Configuration
Quote:
|
Re: RoboRIO SPI Configuration
Quote:
The old SPI class from the WPI library wasn't actually SPI. On the CRio it would bit bang the Digital IO ports to act like SPI. The problem with that is the software had to take resources away from other tasks to emulate SPI. The RoboRio has dedicated hardware for SPI so it doesn't need to take away valuable resources from the rest of the robot. I don't know why they didn't put in the bits per word setting into the new SPI class. The only reason I can think of is that a lot of IC's use 7 bits per word. But that doesn't explain why they wouldn't give us the option to change it. |
| All times are GMT -5. The time now is 12:07. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi