Well I was just amount to post a reply to my own thread lamenting the fact that I hadn't received any replies yet..but you beat me to the punch Joe!
Quote:
|
I believe the geartooth sensor class doesn't support that, but the FPGA and the Counter classes support it. You just need to use the kPulseLength mode.
|
I do see that the GearTooth class is calling Counter::SetPulseLengthMode()
Code:
void GearTooth::EnableDirectionSensing(bool directionSensitive)
{
if (directionSensitive)
{
SetPulseLengthMode(kGearToothThreshold);
}
}
where kGearToothThreshold is defined as 55e-6. So its looking like this class IS setup for direction.
Quote:
|
The serial interface would work with SPI, not I2C.
|
This I figured out on my own today and I just finished up the first draft of a class for implementing the SPI interface with the sensor. I uploaded the project to our repository (
http://code.google.com/p/first-team63/source/browse/#svn%2Ftrunk%2FDevelopment%2FApps%2FcRIO%2FAS5030_ SPI). I can also attach the code here as a zip if anyone requests. Joe, I would appreciate your comments on this code if you have a moment to look over it. I used the sample code in one of the specs as a reference. One thing I wasn't sure about was a function they were using called DIO_HIGH_IMP() that they didn't show the definition of. This function was to change the mode of the DIO pin to input mode. I just kinda left this out of my code and i am hoping that is ok because we are using the DIO pin as output only in the 4 line configuration.
Quote:
|
The last method (I know... there are a ton) is the sin cos test mode. I personally think this is the best way to interface it. You need to do a bit of soldering to enable that mode, but you would then wire the sin and cos signals to the analog input. Those then are configured with 2 analog triggers. and the outputs of those are hooked up to a quadrature decoder. Awesome!
|
I think I will see how my SPI interface treats me before I dive into this one! I am gathering though that the AnalogTrigger and AnalogTriggerOutput class would somehow be used to create a simulated DigitalInput to pass to the Encoder class? This one looks tough...