Go to Post "It doesn't matter what you think happened, what the Ref calls (or doesn't) is what happened. The judgement of the Ref is part of the game, live with it or don't play." - ChrisH [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 Yesterday, 20:34
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: 678
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
Cannot find ADXRS450

Did anything changed with regard to the ADXRS450 gyro since last season? We got an error on the Driver Station saying it cannot find the gyro. Looking at the source code, it looks like it failed to validate the part ID:
Code:
    // Validate the part ID
    if ((readRegister(kPIDRegister) & 0xff00) != 0x5200) {
      m_spi.free();
      m_spi = null;
      DriverStation.reportError("could not find ADXRS450 gyro on SPI port " + port.value,
          false);
      return;
    }
Thinking that the part may be defective, we ordered new gyro and it came yesterday and has the same error.
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread Yesterday, 21:14
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 40
MuskieProgramme is an unknown quantity at this point
Re: Cannot find ADXRS450

Rookie team here, we plugged it in and it worked. Maybe the roboRIO SPI port is broken?
Reply With Quote
  #3   Spotlight this post!  
Unread Yesterday, 22:05
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: 678
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: Cannot find ADXRS450

Quote:
Originally Posted by MuskieProgramme View Post
Rookie team here, we plugged it in and it worked. Maybe the roboRIO SPI port is broken?
We have two RoboRIO's and they both showed the same error.
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread Today, 04:33
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: 678
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: Cannot find ADXRS450

Quote:
Originally Posted by mikets View Post
We have two RoboRIO's and they both showed the same error.
We still couldn't figure out why the ADXRS450 gyro is not working. I stripped down an Iterative robot template code and just added the gyro code and it still said "cannot find the gyro on SPI port 0".
Code:
package org.usfirst.frc.team492.robot;

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

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Robot extends IterativeRobot {
    ADXRS450_Gyro gyro;

	/**
	 * This function is run when the robot is first started up and should be
	 * used for any initialization code.
	 */
	@Override
	public void robotInit() {
	    gyro = new ADXRS450_Gyro();
	}

	/**
	 * This autonomous (along with the chooser code above) shows how to select
	 * between different autonomous modes using the dashboard. The sendable
	 * chooser code works with the Java SmartDashboard. If you prefer the
	 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
	 * getString line to get the auto name from the text box below the Gyro
	 *
	 * You can add additional auto modes by adding additional comparisons to the
	 * switch structure below with additional strings. If using the
	 * SendableChooser make sure to add them to the chooser code above as well.
	 */
	@Override
	public void autonomousInit() {
	}

	/**
	 * This function is called periodically during autonomous
	 */
	@Override
	public void autonomousPeriodic() {
	}

	/**
	 * This function is called periodically during operator control
	 */
	@Override
	public void teleopPeriodic() {
	}

	/**
	 * This function is called periodically during test mode
	 */
	@Override
	public void testPeriodic() {
	}
}
I do not think it is hardware related because we tried two ADXRS450 gyro's, one of which completely brand new from AndyMark. We also tried two RoboRIO's and got the same error. So the only thing left is the RoboRIO image. What is the latest RoboRIO image version? We have v8.
BTW, if we commented out the gyro, everything else work. We have the robot running on mecanum wheels and operating pneumatics. So the imaging process should be fine as well as the Java VM on the RoboRIO. I am running out of ideas on why it doesn't work.
I even stripped down the ADXRS450_Gyro class code and discovered that the readRegister call below was returning 4 bytes of zeros.
Code:
      // Validate the part ID
      if ((readRegister(kPIDRegister) & 0xff00) != 0x5200) {
        m_spi.free();
        m_spi = null;
        tracer.traceInfo("GyroTest", "Failed to find ADXRS450 gyro on SPI port %d.", port.value);
        return;
      }
So it was truly not finding the gyro. Is there anything trivial that I missed? Perhaps a jumper or config option that enables/disables SPI in the RoboRIO image? BTW, the jumper on the ADXRS450 gyro was jumped to CS0.
__________________
Reply With Quote
  #5   Spotlight this post!  
Unread Today, 09:50
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 40
MuskieProgramme is an unknown quantity at this point
Re: Cannot find ADXRS450

We have v8 on both of our RIOs. We did not change any settings or any jumpers.
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 13:15.

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