I have a basic stamp 2 and if i got another type stamp that had more slots would I have to relearn the programing to program that stamp to do what I wanted?
-- Chessking
You would not have to relearn PBasic as it works with all stamps. However, depending on the Stamp used you would need to change any mathematical and or Time values to what your Stamp version is. If you search for Case in PBasic Help and look under Freqout Examples you will see what I am talking about.
Spkr PIN 10 ' output pin for FREQOUT
#SELECT $STAMP
#[COLOR=#000000][B][COLOR=#000000][B][COLOR=#000000][B]CASE[/B][/COLOR][/B][/COLOR][/B][/COLOR] BS2, BS2E
TmAdj CON $100 ' x 1.0 (time adjust)
FrAdj CON $100 ' x 1.0 (freq adjust)
#[COLOR=#000000][B][COLOR=#000000][B]CASE[/B][/COLOR][/B][/COLOR] BS2SX
TmAdj CON $280 ' x 2.5
FrAdj CON $066 ' x 0.4
#[COLOR=#000000][B]CASE[/B][/COLOR] BS2P
TmAdj CON $3C5 ' x 3.77
FrAdj CON $044 ' x 0.265
#[COLOR=#000000][B][COLOR=#000000][B][COLOR=#000000][B]CASE[/B][/COLOR][/B][/COLOR][/B][/COLOR] BS2PE
TmAdj CON $100 ' x 1.0
FrAdj CON $0A9 ' x 0.66
#[COLOR=#000000][B][COLOR=#000000][B]CASE[/B][/COLOR][/B][/COLOR] BS2PX
TmAdj CON $607 ' x 6.02
FrAdj CON $02A ' x 0.166
#ENDSELECT
You would not have to relearn PBasic as it works with all stamps. However, depending on the Stamp used you would need to change any mathematical and or Time values to what your Stamp version is. If you search for Case in PBasic Help and look under Freqout Examples you will see what I am talking about.
Spkr PIN 10 ' output pin for FREQOUT
#SELECT $STAMP
#[COLOR=#000000][B][COLOR=#000000][B][COLOR=#000000][B]CASE[/B][/COLOR][/B][/COLOR][/B][/COLOR] BS2, BS2E
TmAdj CON $100 ' x 1.0 (time adjust)
FrAdj CON $100 ' x 1.0 (freq adjust)
#[COLOR=#000000][B][COLOR=#000000][B]CASE[/B][/COLOR][/B][/COLOR] BS2SX
TmAdj CON $280 ' x 2.5
FrAdj CON $066 ' x 0.4
#[COLOR=#000000][B]CASE[/B][/COLOR] BS2P
TmAdj CON $3C5 ' x 3.77
FrAdj CON $044 ' x 0.265
#[COLOR=#000000][B][COLOR=#000000][B][COLOR=#000000][B]CASE[/B][/COLOR][/B][/COLOR][/B][/COLOR] BS2PE
TmAdj CON $100 ' x 1.0
FrAdj CON $0A9 ' x 0.66
#[COLOR=#000000][B][COLOR=#000000][B]CASE[/B][/COLOR][/B][/COLOR] BS2PX
TmAdj CON $607 ' x 6.02
FrAdj CON $02A ' x 0.166
#ENDSELECT
sorry I don't understand would anything be different to program, or would I just have to change the version in the editor
You would have to change the version number in the editor and some constants would have to be different i.e. different stamps use different units. For example:
BS2:
PULSEOUT 12, 750
BS2PX:
PULSEOUT 12, 1875
These two lines both do the same thing, emit a 1300µs pulse on pin 12, but the pulse width unit for BS2 is 2.0µs while it is 0.8µs for the BS2PX.
In other words, look at the multiplier. A BS2SX is 2.5 times faster than a BS2 for Timing and .4 times faster for Freq adjustment. A BS2P is 3.77 and .265, a BS2PE is same timing but .66 on Freq adjustment and a BS2PX is 6.02 and .166. You can either do the multiplication yourself when inputting values in to your code or you can use the Case Statement.
Yes, the only thing you'd have to change in your program is the $STAMP directive so the Stamp Editor will know that you're using a BS2e instead of a BS2. All of the timings will be the same. You'll get additional slots and you'd get some scratchpad RAM to use with the GET and PUT statements.
Yes, the only thing you'd have to change in your program is the $STAMP directive so the Stamp Editor will know that you're using a BS2e instead of a BS2. All of the timings will be the same. You'll get additional slots and you'd get some scratchpad RAM to use with the GET and PUT statements.
how do you switch between slots?
and is there any way to buy a bs2e alone without buying anything else
Do consider moving to one of the Stamps in the "p" series, instead of to the BS2e. The p series offers more scratchpad RAM space for extra variables, easy transfer of data between the slots, and easy interface to things like devices that use the i2c or one-wire protocols. The BS2pe in many respects has the same timing as the original BS2, especially for the serial commands. What do you want to do?
Look at the Nuts and Volts article mentioned (here) for information on the GET, PUT, and RUN statements. The Basic Stamp Syntax and Reference Manual also discusses these statements and how to use the $STAMP directive to load programs into specific slots.
You can buy any of the Stamp modules from Parallax's webstore. If you have a board like the Stamp Board of Education or the Super Carrier Board or any of the 3rd party boards designed to plug in a Stamp module, you can use the BS2e or other Stamp model in the socket supplied. You can also make your own board with a 24-pin IC socket and connect the module as shown in the Reference Manual.
Look at the Nuts and Volts article mentioned (here) for information on the GET, PUT, and RUN statements. The Basic Stamp Syntax and Reference Manual also discusses these statements and how to use the $STAMP directive to load programs into specific slots.
You can buy any of the Stamp modules from Parallax's webstore. If you have a board like the Stamp Board of Education or the Super Carrier Board or any of the 3rd party boards designed to plug in a Stamp module, you can use the BS2e or other Stamp model in the socket supplied. You can also make your own board with a 24-pin IC socket and connect the module as shown in the Reference Manual.
You can't. The BS2 has only the one slot, so there's no switching. All the other models (BS2e, BS2sx, BS2p/pe/px) have multiple slots and statements to use them. The BS2p series has some statements that the BS2e and BS2sx don't have that add extra abilities and simplify slot use. Look at the Nuts & Volts Column I mentioned earlier for specifics on this.
Comments
BS2:
PULSEOUT 12, 750
BS2PX:
PULSEOUT 12, 1875
These two lines both do the same thing, emit a 1300µs pulse on pin 12, but the pulse width unit for BS2 is 2.0µs while it is 0.8µs for the BS2PX.
and is there any way to buy a bs2e alone without buying anything else
You can buy any of the Stamp modules from Parallax's webstore. If you have a board like the Stamp Board of Education or the Super Carrier Board or any of the 3rd party boards designed to plug in a Stamp module, you can use the BS2e or other Stamp model in the socket supplied. You can also make your own board with a 24-pin IC socket and connect the module as shown in the Reference Manual.