Shop OBEX P1 Docs P2 Docs Learn Events
switching from BS2 to BS2sx — Parallax Forums

switching from BS2 to BS2sx

Johnny-5Johnny-5 Posts: 34
edited 2006-12-11 17:22 in BASIC Stamp
is the PWM different between the two? Would i have to change my old BS2 programs to work with the BS2sx?

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2006-12-10 00:26
    The BS2sx runs about 2.5 times faster, so anything that depends on timing ( serin, serout, pwm, etc, etc) works exactly the same, other than the values of the parameters will be a bit different. Have a look in the helpfile for any commands you're using. The differences are spelled out clearly.

    Its a great chip and the extra speed and memory are well worth learning to use.

    Cheers

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Johnny-5Johnny-5 Posts: 34
    edited 2006-12-11 08:18
    well... i dug thought the help file a bit and all it states is that the BS2 is 2us and the BS2sx is .8us I know with the center points of my servos with the BS2 (750) but how can i figure what they would be for the sx? Any way i try to figure it it comes out to 300pulses... but i tried values from 0 to like 1000 and it spun the same direction and same speed for all values... Should i change the PAUSE value rather than the PULSOUT value?... im confused
  • FireHelixFireHelix Posts: 42
    edited 2006-12-11 09:14
    if im reading everything right, the pause command isnt your problem.

    2us (units of duration) * 750 (value of servo center pulse) = 1500 us pulse

    for the sx, it's units of duration is 0.8us. time for the good ole algebra 0.8 * X = 1500

    if im understanding everything right (i dont have a sx, just a normal bs2) then X should equal 1875

    pulsout PIN 1875 should give you the same result on the sx that pulsout PIN 750 gives on the normal bs2


    anyone, correct me if im wrong, i hope i read everything right... it's 3am here after all lol

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I know just enough to tinker with something... but not enough to fix it when I break it. Thank the techie gods theres forums...
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-11 17:22
    1875 is the center point for the BS2sx.· I can offer maybe another way to look at things which might make more sense.· First of all the center point on the servo is 1.5 mS.· It might be better to look at it in uS since the units are listed that way.· When we do this we have 1500 uS.· If you divide 1500 by .8 you get 1875.· You can do this with the full range as well.· The typical range is from 1 mS to 2 mS or 1000 uS to 2000 uS.· That range on the BS2sx would be 1250 to 2500.· I hope looking at it this way will help others as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.