shiftout- mac and pc stamp editor different?
Jonathan
Posts: 1,023
Hi All,
I have been playing with a Vector2XE compass module. I had some trouble getting it going, and so called the tech guy at PNI. Running the BS2P code they provided didn't work correctly. The tech guy fired his BS2P up and ran the code, no problem. We went around and around for a while, trying all sorts of stuff, including sending me a new unit.
Finally,·it turned out that he had used a MAC when writing the code. So we wondered if it could be a big endian/little endian thing. By transposing the array that collects the sensor readings we got it to work.
Is this a known difference between the MAC and PC editor? Is there a Parallax MAC version, or is it 3rd party?
Anyway, just a heads up. The Vector 2XE is a GREAT sensor.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
I have been playing with a Vector2XE compass module. I had some trouble getting it going, and so called the tech guy at PNI. Running the BS2P code they provided didn't work correctly. The tech guy fired his BS2P up and ran the code, no problem. We went around and around for a while, trying all sorts of stuff, including sending me a new unit.
Finally,·it turned out that he had used a MAC when writing the code. So we wondered if it could be a big endian/little endian thing. By transposing the array that collects the sensor readings we got it to work.
Is this a known difference between the MAC and PC editor? Is there a Parallax MAC version, or is it 3rd party?
Anyway, just a heads up. The Vector 2XE is a GREAT sensor.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Post Edited (Jon Williams) : 4/6/2005 5:22:00 PM GMT
When the end analysis of this problem is in hand, it may answer a lot of question that have arisen over a long period of time. Almost everyone, myself included, seems to have had problems in getting the Vector 2X (new and old versions) to operate properly and consistantly.
I suppose it possible that those who were successful used one platform (Mac or PC) and those who were not, used the other. This is especially true if some of the specifications, examples or results of the PNI testing are a result of their using a Mac, rather than a PC. It certainly would have been wise of them to do their testing using both platforms.
Obviously Parallax can not be held responsible for any unique results that come from using the Mac version of the Stamp Editor. It sure sounds like some cross-platform testing is in order.
Could you be a bit more specific about which arrays you're speaking about, and how they differ between the two platforms?
Thanks for making us all aware of the potential problem. I may dig out my Vector 2X again.
Regards,
Bruce Bates
I should have known the MAC version wasn't from Parallax. If it was it would have worked right! I have no idea which MAC toxenizer PNI is using, so I can't say what tokenizers·are affected by this issue.
Bruce, the following applies to the BS2P code for the Vector2XE. I have not played with the 2X, so I don't know if it is the same. What are your symptoms? Mine was that the heading was always 0.
If you look in the "Heading" program you will see the line:
SHIFTIN MISO,SCLK,MSBPRE,[noparse][[/noparse]FrameIn,CountIn,HeadingIn,HeadingVal(2),HeadingVal(3),HeadingVal(1),HeadingVal(0),TermIn]
If you look at the stock code you will see that they HeadinVal array is in a different order. Change it to match the above and see if it works.
PNI is changing the code on the website to reflect this issue. I will be putting up a page about using the unit on my site sometime soon as well.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
PNI is using MacBS2 version 2.0b9 to tokenize. Julian (the guy at PNI) just tried the old code on a Windows machine using the old v1.33 Parallax editor, and it worked! No changes needed. I am going to dig up a copy of v1.33 and see if it is the same for me. If so, we'll have to figure out why. However, this may help further explain erratic results amongst those trying to use these sensors.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
As for the Vector 2X, it·uses different firmware and a different protocol, so·please let me know specifically what the·problems are and I can look into it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Julian Benton
Applications Engineer
PNI Corporation
jbenton@pnicorp.com
Jonathan, a few weeks ago we had a discussion here about the Dinsmore R1655. That was a code issue. I was wondering, did you get that one to work?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Tracy, I did get the Dinsmore sensor working, sorta. The problem is that the curves were not crossing as they should, so selecting the right quadrant was being problematic. I'm not sure if the sensor is damaged or what. One way to make it easier to deal with this problem would be to use an ADC with a - and + Vref, and narrow the range a little for greater resolution. If you would like to play with the sensor, let me know off list and I'll send it to you and explain in detail what was going on.
However, when I found out about the Vector2XE, I decided to give that a whirl, and I'm glad I did. This unit saves a lot of coding overhead and HAS NO OVERSWING. That's right, you don't have to let it settle. The Disnmore unit takes up to 3 seconds to settle if you have a radical high speed change. The Vector delivers a readeing of where the sensor is when you ask it. I am going to be working on integrating the compass into my servo and odometer controller this week. Should be pretty cool..
BTW, one thing about the Vector2XE is that you have to provide it with a 3V power supply, not 5V.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Post Edited (Jonathan) : 4/6/2005 7:58:34 PM GMT
I see that the issue of settling time could be important in your moving platform. Dinsmore treats the 3 second settling time as a feature, to average out noise and jerky motions. I think I read somewhere that you could order it with the lowpass filter disabled or with a different time constant. I think I would rather have the instantaneous reading, and do the filtering in software if necessary.
-- Tracy
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com