The Functions Available From The imp002’s Pins
The imp002 solder-down modules provide all of the same pins as the imp001, with all the same functions, plus five more pins: 6 and A through E.
|5||TX||SCLK||Yes||Yes||Yes||For Pin 7|
|8||TX||SCL||MOSI||Yes||Yes||For Pin 5, 9
|9||RX||SDA||MISO||Yes||Yes||For Pin 2|
All of the imp002’s pins are tri-stated (floating) by default, ie. on power on, after chip reset, or after deep sleep.
In GPIO mode pins may source or sink up to 4mA.
All of the imp002’s pins are tristated (floating) by default, ie. on power on, after chip reset, or after deep sleep.
The wakeup pin, pin 1, can be used to wake the imp002 from a deep sleep, but only if the pin is configured with this capability before the imp002 goes into deep sleep. To configure the pin for this role, use the following code:
Once the imp002 is in deep sleep — typically with a server.sleepfor() or server.sleepuntil call — setting pin 1 to logic high will wake the device. However, Squirrel is started afresh so the registered callback request will be lost. The callback function will be called if the imp002 is already awake when the pin is triggered.
The imp002 wakes when the pin is high, not on the rising edge. The external device responsible for signalling the wakeup pin should subsequently drive the pin low; the imp002 cannot return to sleep if the wakeup pin is high. An internal pull-down is automatically enabled when wakeup is configured.