Shop OBEX P1 Docs P2 Docs Learn Events
shiftout- mac and pc stamp editor different? — Parallax Forums

shiftout- mac and pc stamp editor different?

JonathanJonathan Posts: 1,023
edited 2005-04-07 16:46 in BASIC Stamp
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

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-06 16:39
    Parallax does not produce a Mac version of a BASIC Stamp editor; just Windows. Any Mac product you've found comes from a 3rd party (which we enable by making our tokenizer available as a module).· There shouldn't be differences in the output though ... the module that third-party vendors use to compile PBASIC source code is the same one we use.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA


    Post Edited (Jon Williams) : 4/6/2005 5:22:00 PM GMT
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-04-06 17:08
    Jonathan -

    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
  • JonathanJonathan Posts: 1,023
    edited 2005-04-06 17:54
    Hi All,

    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
  • JonathanJonathan Posts: 1,023
    edited 2005-04-06 18:27
    A little update to my last post...

    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
  • JulianJulian Posts: 2
    edited 2005-04-06 18:50
    Actually, I have used both the PC and the Mac versions and all has worked fine for me.· Another engineer here has used the same code (V2Xe Heading) in his own personal project and never mention any issues with it to me.

    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
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-04-06 19:01
    I'll add too that Murat Konar, the developer of MacBS2, is very responsive to bugs or difficulties you may encounter. He recently worked out a couple of issues I had in moving files back an forth from Mac to PC (having to do with a line feed issue) I have had no problems running large multibank programs, in particular, nothing related to the endedness of variables. In any case, MacBS2 uses the tokenizer supplied by Parallax, and that is what translates the text source code into PBASIC tokens. So I don't see how that could be the problem with the compass.

    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
  • JonathanJonathan Posts: 1,023
    edited 2005-04-06 19:52
    Well, it gets a little weirder. PNI has no problems using the old editor or the new one with the stock code. I have tried three computers with both the old editor and the new one and I have to change the code in order to get it to work.

    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
  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-04-07 16:46
    Maybe I will take you up on that and have a crack at the Dinsmore R1655. There should not be any need to decide what quadrant it is in, once the sine and cosine functions are properly scaled. The Arctangent operator should take care of that automatically and return a reading in the proper quadrant from 0 to 255 brads.

    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
Sign In or Register to comment.