GPIO
This section refers to the following sample application(s):
02-gpio02-gpio_net
A General Purpose Input/Output (GPIO) is a pin that can be configured in software to serve either as an input or as an output pin. On the
chip, all GPIO pins have interrupt capabilities.
When using a DC9003, make sure that the V+ pin is never in contact with any other pin on the mote. The DC9006 supplies 12V through this pin, and connecting any mote IO to it will destroy the mote.
GPIO on
The following list shows the device names, the pins they are mapped to, and the location of the pins on the
board. Some of the pins are reserved for internal use by the
, and must not be used by your application.
When using a GPIO as an input as arming notifications, we recommend you introduce a delay (e.g. 100ms) when re-arming the notification to the opposite level for de-bouncing.
Device Name | Special Function | board | |||||
Header | Silkscreen text | pin name | pin number | pin name | pin number | ||
|---|---|---|---|---|---|---|---|
| SPI Master Slave Select 2 (active low) | P2 |
|
| 36 |
| 28 |
| IPCS Slave Select | P1 |
|
| 45 |
| 39 |
| IPCS Clock | P1 |
|
| 44 |
| 36 |
| IPCS Master-Out-Slave-In | P1 |
|
| 42 |
| 35 |
| IPCS Master-In-Slave-Out | P1 |
|
| 40 |
| 33 |
| SPI Master Master Clock | P3 |
|
| 43 |
| 41 |
| SPI Master Master-Out-Slave-In | P3 |
|
| 41 |
| 40 |
| SPI Master Master-In-Slave-Out | P3 |
|
| 39 |
| 38 |
| SPI Master Slave Select 0 (active low) | P3 |
|
| 47 |
| 44 |
| SPI Master Slave Select 1 (active low) | P2 |
|
| 46 |
| 43 |
| P2 |
|
| 49 |
| 46 | |
| P2 |
|
| 48 |
| 45 | |
| P2 |
|
| 34 |
| 26 | |
| P2 |
|
| 33 |
| 25 | |
| P2 |
|
| 27 |
| 21 | |
| SPI Slave Master-Out-Slave-In | P2 |
|
| 51 |
| 48 |
The 02-gpio Sample Application
To see the state of the LED on the
board, you need to close the LED EN jumper.
The 02-gpio sample application creates two tasks:
The gpioToggleTask() task configures a pin as output and toggles its state every second. On the
board, this corresponds to the blue LED.
The gpioNotifTask() task waits for notifications from a different pin configured as input. On the
board, this corresponds to the pin labeled
DP2on the silkscreen. Connecting this pin to the supply voltage triggers a notification; disconnecting it triggers another one, as shown in the CLI output captured below: