PDA

View Full Version : How to differentiate between BS2p24 and BS2P40?



daniel
08-04-2005, 11:58 AM
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

Tracy Allen
08-04-2005, 03:21 PM
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 (http://www.emesystems.com)

daniel
08-04-2005, 06:07 PM
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