GPIO

GPIO

This section refers to the following sample application(s):

  • 02-gpio

  • 02-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

DN_GPIO_PIN_0_DEV_ID

SPI Master Slave Select 2 (active low)

P2

DP0/M SS2n

DP0/GPIO0

36

DP0

28

DN_GPIO_PIN_3_DEV_ID

IPCS Slave Select

P1

I SSn

IPCS_SSn

45

IPCS_SSn/GPIO3

39

DN_GPIO_PIN_4_DEV_ID

IPCS Clock

P1

I SCK

IPCS_SCK

44

IPCS_SCK/GPIO4

36

DN_GPIO_PIN_5_DEV_ID

IPCS Master-Out-Slave-In

P1

I MOSI

IPCS_MOSI

42

IPCS_MOSI/GPIO5

35

DN_GPIO_PIN_6_DEV_ID

IPCS Master-In-Slave-Out

P1

I MISO

IPCS_MISO

40

IPCS_MISO/GPIO6

33

DN_GPIO_PIN_9_DEV_ID

SPI Master Master Clock

P3

M SCK

SPIM_SCK

43

SPIM_SCK

41

DN_GPIO_PIN_10_DEV_ID

SPI Master Master-Out-Slave-In

P3

M MOSI

SPIM_MOSI

41

SPIM_MOSI

40

DN_GPIO_PIN_11_DEV_ID

SPI Master Master-In-Slave-Out

P3

M MISO

SPIM_MISO

39

SPIM_MISO

38

DN_GPIO_PIN_12_DEV_ID

SPI Master Slave Select 0 (active low)

P3

M SS0n

SPIM_SS_0n

47

SPIM_SS_0n

44

DN_GPIO_PIN_13_DEV_ID

SPI Master Slave Select 1 (active low)

P2

M SS1n

SPIM_SS_1n

46

SPIM_SS_1n

43

DN_GPIO_PIN_16_DEV_ID



P2

PWM0

PWM0

49

PWM0

46

DN_GPIO_PIN_20_DEV_ID



P2

DP1/IO20 (D5/D8 LEDs)

DP1

48

DP1

45

DN_GPIO_PIN_21_DEV_ID



P2

DP2

DP2

34

DP2/GPIO21

26

DN_GPIO_PIN_22_DEV_ID



P2

DP3/IO22 (D7/D10 LEDs)

DP3

33

DP3

25

DN_GPIO_PIN_23_DEV_ID



P2

DP4 (D6/D9 LEDs)

DP4

27

DP4

21

DN_GPIO_PIN_26_DEV_ID

SPI Slave Master-Out-Slave-In

P2

S MOSI

SPIS_MOSI

51

GPIO26/SPIS_MOSI

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 DP2 on 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: