The BASIC Stamp 2p40 Module is a practical and powerful microcontroller for all kinds of embedded projects. Also makes Julienne fries!
The BASIC Stamp 2p modules represent the next generation in Stamp technology. They run faster processors that are more efficient and have more program memory than ever before.
Many new powerful commands for I2C, LCD panels and One Wire devices (such as the iButton) are built-into the Stamp 2p modules.
BASIC Stamp 2p-40 has several advantages over all previous BASIC Stamps. It is 3 times faster than a BS2 and 20% faster than the BS2-SX. Commands for interfacing with parallel LCDs, I2C devices and Dallas Semiconductor 1-Wire parts have been added along with a polled interrupt capability. Since it is a 40-pin module, you also get double the number of I/O pins: 32, for your application.
The BS-2P's on-board ceramic resonator runs at 20 MHz; and executes code 3 times faster than the BS2 operating at 20 MHz. This means that the Stamp executes 12,000 lines of PBASIC code every second rather than just 4,000.
This is probably the biggest improvement for most Stamp users. The BS2P has eight 2K program banks(the BS2 has just one). Unfortunately, the 16K can't be used as one big chunk of memory. Every time you jump from 1 program bank to the next, all the variable space is erased and all I/O pins are set to INPUTS. To get around this, there are 127 bytes of 'scratch pad' RAM. Two new commands, PUT and GET allow the programmer to store/retrieve important variables to/from scratch-pad RAM before jumping to another program bank. The added command STORE improves the ability to use the READ and WRITE commands over the full memory range.
With all that extra power, the current that the BS2P has been reduced compared to the BS2-SX. You can expect to have to feed it 40 mA, plus any extra current sourced or sunk by the I/O pins. For most applications, this isn't a problem but if you're running on batteries, you'll want to put the Stamp to sleep at every opportunity.