Shop OBEX P1 Docs P2 Docs Learn Events
How to differentiate between BS2p24 and BS2P40? — Parallax Forums

How to differentiate between BS2p24 and BS2P40?

danieldaniel Posts: 231
edited 2005-08-04 10:07 in BASIC Stamp
Is there a way to use the built-in $STAMP (or something else) to make a compile-time differentiation between the 24-pin and the 40-pin BS2p?·

I know I can do:
#IF $STAMP <> BS2p #THEN
  #ERROR "Requires a BS2p"
  END
#ENDIF


I would like to do something like:
#IF $STAMP <> BS2p40 #THEN
  #ERROR "Requires a 40-pin BS2p"
  END
#ENDIF



I did not run across this·information in the Help file; the closest I can find is in the AUXIO / MAINIO / IOTERM Example; but that example does not distinguish between the 24-pin and the 40-pin BS2p.

Daniel

...

Post Edited (daniel) : 8/4/2005 4:02:47 AM GMT

Comments

  • Tracy AllenTracy Allen Posts: 6,658
    edited 2005-08-04 07:21
    The built-in $STAMP does not make that distinction, I think. You can burn a program for a BS2p24 into a BS2p40 and vice versa and the IDE won't complain. It does have that information in the feedback from the chip, but it doesn't enforce any difference. AFAIK.

    You could make your own directive:

    #DEFINE BS2PTYPE=40 ' or 24
    #IF BS2PTYPE=40 #THEN
    AUXIO
    DIRS=$FFFF
    #ENDIF

    That directive could also enforce the type=40 with the #ERROR message, just as a reminder of the type required.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • danieldaniel Posts: 231
    edited 2005-08-04 10:07
    Tracy,

    Thanks for the tip.· I'll make use of that somehow.

    As for the original request, I'm looking for that additional bit of chip-level information that, as you suggest, already exists.· Specifically, I would expect that
    #IF $STAMP = BS2p #THEN
    

    would be true for any BS2p.

    I'm looking for the chip's self-report to additionally allow me to differentiate between the different BS2p.· I don't think I require that I be able to assign the BS2p40 attribute, just that the Identify function be able to distinguish between them.· I'd be willing to use another built-in constant, such as $PINCOUNT or $MODEL·to allow the differentiation, as

    #IF $STAMP = BS2p AND $PINCOUNT = 40 #THEN
    


    Daniel
Sign In or Register to comment.