Thread: Java SPI comm
View Single Post
  #4   Spotlight this post!  
Unread 26-01-2013, 00:44
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Java SPI comm

Quote:
Originally Posted by mitchellweb1 View Post
Here is the SPI code that I have been working on for WPILibJ http://users.wpi.edu/~mwills/frc/.
Thanks for working on this!

I've been playing with this code and had trouble with the chip select being short when I used a slower clock rate. I traced this to calling the following code after the transfer (in the transfer method)

Code:
            tSPI.writeChannels_SS_Module(0);
            tSPI.writeChannels_SS_Channel(0);
I commented it out and things are working. This might break if there are multiple devices on the bus, but I'm only using one. My problem might have been aggravated because I'm using a write only device and I had to remove the loop waiting for the read.

Last edited by Joe Ross : 26-01-2013 at 09:39.