|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
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;
}
|
|
#2
|
|||
|
|||
|
Re: Cannot find ADXRS450
Rookie team here, we plugged it in and it worked. Maybe the roboRIO SPI port is broken?
|
|
#3
|
||||
|
||||
|
Re: Cannot find ADXRS450
We have two RoboRIO's and they both showed the same error.
|
|
#4
|
||||
|
||||
|
Re: Cannot find ADXRS450
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() {
}
}
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;
}
|
|
#5
|
|||
|
|||
|
Re: Cannot find ADXRS450
We have v8 on both of our RIOs. We did not change any settings or any jumpers.
|
|
#6
|
||||
|
||||
|
Re: Cannot find ADXRS450
I tested our gyro on another team's RoboRIO and it worked. So I know now that there is nothing wrong with the gyro. It's running the same test code. So there is something wrong with our RoboRIO. Since it happens on both of our RoboRIOs, I am assuming it is more likely a configuration issue although I have checked that we have 2017_v8 image and v3.0f firmware version. Everything seems to check out fine. So I am puzzled on why the gyro is not working on our RoboRIOs with the same test code. I would like to check out if there is really hardware issues with the SPI bus on our two RoboRIOs. Any cheap SPI bus analyzer that I can get? Don't want to get the $300 ones. Anybody has experience on the Bus Pirate sold by Sparkfun? https://www.sparkfun.com/products/12942
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|