Shop OBEX P1 Docs P2 Docs Learn Events
help on using different BS2 models — Parallax Forums

help on using different BS2 models

Miles. kMiles. k Posts: 34
edited 2009-12-21 16:54 in BASIC Stamp
I'm considering switching from my BS2 to a "BS2p 40pin" and i have a few questions.

1. I know the BS2p is faster; so how would i go about converting "PULSOUT" commands
like "PULSOUT 750" to "PULSOUT ???"

2. The BS2p 40pin has more IO pins; so how would i go about using one of those AUX pins?

Thanks,
Miles

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-21 05:45
    1) The BASIC Stamp Syntax and Reference Manual (and the Stamp Editor help files) have tables in the chapters on each statement that give the timing conversion factor for each of the statements that's time dependent. For things like PULSOUT, the time unit is 2us on the BS2 while it's 0.8us on the BS2p which includes the 40-pin version. 750 at 2us per unit = 1500us. For the BS2p40, the PULSOUT would need 1500us/0.8us = 1875.

    2) Read the descriptions of the AUXIO and MAINIO statements. Essentially, the BS2p40 has two banks of 16 I/O pins and one bank can be accessed at a time using the standard I/O pin numbering using 0-15. The default bank is selected by using MAINIO and the other bank is selected by using AUXIO.
  • Miles. kMiles. k Posts: 34
    edited 2009-12-21 06:43
    1. Im kinda grasping the subject but im still a little confused

    2. I looked up AUXIO in my "Basic Stamp Syntax and Reference manual" and found info on "Page 129-131" and now i fully under stand.

    Thanks Mike,
    your ALL WAYS a great help [noparse]:)[/noparse]
  • stamptrolstamptrol Posts: 1,731
    edited 2009-12-21 12:58
    You'll have no major problems learning to live with the BS2p-40. I just finished a project and the extra memory, extra i/o, and faster speed make the transistion worthwhile.

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

    http://www.siskconsult.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2009-12-21 16:54
    #1:
    Some of the Stamp statements that use timing, like PAUSE, are independent of the Stamp model used because the time is stated in milliseconds.

    Most of the Stamp statements that use timing use an arbitrary unit which is 2us on the BS2, BS2e, and BS2pe and 0.8us on the BS2sx, BS2p, and BS2px. You have to adjust the numbers that you use for these statements to fit the unit used. I showed how you'd change a PULSOUT statement. The same would hold true for a PULSIN statement which sets its variable to the number of units that the input pulse takes. A 1ms input pulse would produce a value of 500 on a BS2. It would produce a value of 1250 on a BS2p40.
Sign In or Register to comment.