Go to Post Thank God for the Technokats. - Koko Ed [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 15-03-2016, 19:40
NewProgrammer NewProgrammer is offline
Registered User
no team
 
Join Date: Mar 2016
Location: Michigan
Posts: 2
NewProgrammer is an unknown quantity at this point
"Could not find ADXRS450 gyro on SPI port 0" Error - Java

Hello Chief Delphi,

I am attempting to implement the ADXRS450 gyroscope (http://firstchoicebyandymark.com/fc16-000) that was included in the kit of parts this year with Java, but running into the following problem:

ERROR 1 could not find ADXRS450 gyro on SPI port 0 org.usfirst.frc.team1188.robot.Robot.robotInit(Rob ot.java:10)

I have looked at this CD thread and this FRC Reddit post, as well as several other CD threads relating to this chip and the Analog Devices FRC page, but nothing has helped me.

Here is code from my Robot.java file. I was trying to just isolate the gyro, and have no logic in any of the other methods (teleop periodic, etc.)

Code:
import edu.wpi.first.wpilibj.ADXRS450_Gyro;
import edu.wpi.first.wpilibj.IterativeRobot;

public class Robot extends IterativeRobot {    
    ADXRS450_Gyro gyro;
	
    public void robotInit() {
    	gyro = new ADXRS450_Gyro();   // This is the line specified in the error message.
    }
}
I get a very similar error when trying to use the chip's ADXL362 accelerometer, though it specifies SPI port 1 instead of port 0. I'm hoping the solution to this problem solves that as well, but it's secondary because I can always use the built in accelerometer.

I have tried using the other constructor specified in the wpilib, that requests an SPI port. I have tried both ports 0 and 1; same error for each (but the SPI port in the messages changes as expected.)
I have NOT tried this chip on any other RoboRIO, or any other chip with this code. I have also not tried any other device in this RoboRIO's SPI port, so I can't rule out hardware as a problem. But, I also don't know of a good way to test that quickly.

Has anyone gotten this device to work in Java? The internet seems to have very little information on it in an FRC-context, but with every team getting one this year I'm hoping someone can help.

Please let me know if I need to provide any additional details. Thank you in advance!
Reply With Quote
  #2   Spotlight this post!  
Unread 16-03-2016, 05:14
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 666
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: "Could not find ADXRS450 gyro on SPI port 0" Error - Java

Quote:
Originally Posted by NewProgrammer View Post
Has anyone gotten this device to work in Java? The internet seems to have very little information on it in an FRC-context, but with every team getting one this year I'm hoping someone can help.

Please let me know if I need to provide any additional details. Thank you in advance!
Our team is using this gyro and it works great. We don't have any problems with it.
https://github.com/trc492/Frc2016Fir...492/Robot.java
__________________
Reply With Quote
  #3   Spotlight this post!  
Unread 16-03-2016, 10:33
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 542
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: "Could not find ADXRS450 gyro on SPI port 0" Error - Java

Have you hooked up a probe to the clock and message lines to the spi gyro to make sure that valid data is being exchanged? If the RIO isn't sending data you may have a firmware issue. If data is being sent than either your not lighting the right chip select line or you have an issue with the gyro
__________________
FRC Team 1684 - Head Programmer (2013-2016)
FRC Team 5460 - Programming Mentor (2015-2016)

FIRST in Michigan - Technical Crew (2015-continuing)
Reply With Quote
  #4   Spotlight this post!  
Unread 17-03-2016, 17:55
NewProgrammer NewProgrammer is offline
Registered User
no team
 
Join Date: Mar 2016
Location: Michigan
Posts: 2
NewProgrammer is an unknown quantity at this point
Re: "Could not find ADXRS450 gyro on SPI port 0" Error - Java

Hi mikets and Arhowk, thank you for your replies.

Mikets, under the hood, your code looks similar to our code. I downloaded it and ran it, and I get the same problem. This leads me to believe we have a hardware issue. But, the knowledge that other teams are using this successfully with Java is important, so thank you.

Arhowk, no, we haven't done that. I think that's what our next step needs to be, but unfortunately due to resource constraints (in particular time), I'm not sure that we will in the imminent future. I was hoping this would just be a silly code issue.

I think for now, we will be reverting to the old kit of parts gyro. If we have time to either test our SPI or test a different ADXRS450 sometime before the end of season, we'll try that. If not, perhaps after our season ends.

Thanks again for the help!
Reply With Quote
  #5   Spotlight this post!  
Unread 18-03-2016, 04:42
josephno1's Avatar
josephno1 josephno1 is offline
Registered User
FRC #3647
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: murica
Posts: 20
josephno1 is an unknown quantity at this point
Re: "Could not find ADXRS450 gyro on SPI port 0" Error - Java

We use the same gyro and it works fine. Here is the line that I used to call the gyro.

Code:
public static ADXRS450_Gyro gyro= new ADXRS450_Gyro();
Do you guys use any roboRIO expansions since I don't think it is an error how you guy's code
__________________
Go Team 3647 Millennium Falcons!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:34.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi