Contiki 3.x
Files

The Muntjac is a platform similar to the Zolertia RE-Mote (CC2538 & CC1200/CC1120) that is pin-compatible with the Zolertia Z1. More...

Files

file  board.h
 Header file with definitions related to the I/O connections on the Muntjac platform, cc2538-based.
 

Muntjac LED configuration

LEDs on the Muntjac are connected in the same way as the RE-Mote:

  • LED1 (Red) -> PD5
  • LED2 (Green) -> PD4
  • LED3 (Blue) -> PD3

LED pins are not exposed on the external headers.

#define LEDS_GREEN   (1 << 4)
 LED1 (Green) -> PD4.
 
#define LEDS_BLUE   (1 << 3)
 LED2 (Blue) -> PD3.
 
#define LEDS_RED   (1 << 5)
 LED3 (Red) -> PD5.
 
#define LEDS_CONF_ALL   (LEDS_GREEN | LEDS_BLUE | LEDS_RED)
 
#define LEDS_LIGHT_BLUE   (LEDS_GREEN | LEDS_BLUE)
 Green + Blue (24)
 
#define LEDS_YELLOW   (LEDS_GREEN | LEDS_RED)
 Green + Red (48)
 
#define LEDS_PURPLE   (LEDS_BLUE | LEDS_RED)
 Blue + Red (40)
 
#define LEDS_WHITE   LEDS_ALL
 Green + Blue + Red (56)
 
#define PLATFORM_HAS_LEDS   1
 

UART configuration

On the Muntjac, the UARTs are connected to the following ports/pins:

  • UART0:
    • RX: PA0, connected to CP2104 serial-to-usb converter TX pin
    • TX: PA1, connected to CP2104 serial-to-usb converter RX pin
  • UART1:
    • RX: PC1
    • TX: PC0

UART0 and UART1 are both configured without HW pull-up resistor and neither port supports CTS or RTS. UART0 and UART1 are exposed on the east port. UART0 is also exposed on the south port.

#define UART0_RX_PORT   GPIO_A_NUM
 
#define UART0_RX_PIN   0
 
#define UART0_TX_PORT   GPIO_A_NUM
 
#define UART0_TX_PIN   1
 
#define UART1_RX_PORT   GPIO_C_NUM
 
#define UART1_RX_PIN   1
 
#define UART1_TX_PORT   GPIO_C_NUM
 
#define UART1_TX_PIN   0
 
#define UART1_CTS_PORT   (-1)
 
#define UART1_CTS_PIN   (-1)
 
#define UART1_RTS_PORT   (-1)
 
#define UART1_RTS_PIN   (-1)
 
#define RS485_UART   1
 
#define RS485_UART_BASE   UART_1_BASE
 
#define UART1_CONF_BAUD_RATE   9600
 

ADC configuration

These values configure which CC2538 pins and ADC channels to use for the ADC inputs.

The Muntjac has three accessible ADCs exposed on the north port. ADC 1 and ADC 3 are connected next to 3.3V and ground so that they can be used with phidget-like connectors. All of the exposed ADCs support 3.3V operation only.

  • ADC1 (PA5): ADC1 on Z1 header. Connected to ADC1 header on MS1/MS2.
  • ADC2 (PA4): ADC2 on Z1 header. Connected to ADC2 header on MS1/MS2.
  • ADC3 (PA2): ADC7 on Z1 header. Used for Batvolts on MS1/MS1.

The other ADC channels of the CC2538 are not available for use as the pins are used for the user button and the SD card.

#define ADC_SENSORS_PORT   GPIO_A_NUM
 ADC GPIO control port.
 
#define ADC_SENSORS_ADC1_PIN   5
 ADC1 to PA5, 3V3.
 
#define ADC_SENSORS_ADC3_PIN   2
 ADC3 to PA2, 3V3.
 
#define ADC_SENSORS_ADC2_PIN   4
 ADC2 to PA4, 3V3.
 
#define ADC_SENSORS_ADC4_PIN   (-1)
 ADC4 not declared.
 
#define ADC_SENSORS_ADC5_PIN   (-1)
 ADC5 not declared.
 
#define ADC_SENSORS_ADC6_PIN   (-1)
 ADC6 not declared.
 
#define ADC_SENSORS_MAX   3
 Maximum sensors.
 

Muntjac Button configuration

Buttons on the RE-Mote are connected as follows:

  • BUTTON_USER -> PA3, USR user button, shared with bootloader
  • BUTTON_RESET -> RESET_N line, RST reset CC2538
#define BUTTON_USER_PORT   GPIO_A_NUM
 BUTTON_USER -> PA3.
 
#define BUTTON_USER_PIN   3
 
#define BUTTON_USER_VECTOR   NVIC_INT_GPIO_PORT_A
 
#define PLATFORM_HAS_BUTTON   1
 

Muntjac RAIN_INT configuration

The RAIN_INT is connected to the USD_DETECT as a bodge becausewe forgot to hook up the real pin and are now out.

#define RAIN_INT_PORT   USD_DETECT_PORT
 
#define RAIN_INT_PIN   USD_DETECT_PIN
 
#define RAIN_INT_VECTOR   NVIC_INT_GPIO_PORT_B
 

SPI (SSI0) configuration

These values configure which CC2538 pins to use for the SPI (SSI0) lines, reserved exclusively for the CC1200 RF transceiver.

These pins are exposed on the east port but their use for anything else should be avoided. TX -> MOSI, RX -> MISO

#define SPI0_CLK_PORT   GPIO_B_NUM
 
#define SPI0_CLK_PIN   2
 
#define SPI0_TX_PORT   GPIO_B_NUM
 
#define SPI0_TX_PIN   1
 
#define SPI0_RX_PORT   GPIO_B_NUM
 
#define SPI0_RX_PIN   3
 

SPI (SSI1) configuration

These values configure which CC2538 pins to use for the SPI (SSI1) lines, shared by the micro SD card and M25P16 flash.

This bus is exposed on the south port. No pins are available for external CSn without sacrificing other functionality. TX -> MOSI, RX -> MISO

#define SPI1_CLK_PORT   GPIO_C_NUM
 
#define SPI1_CLK_PIN   4
 
#define SPI1_TX_PORT   GPIO_C_NUM
 
#define SPI1_TX_PIN   5
 
#define SPI1_RX_PORT   GPIO_C_NUM
 
#define SPI1_RX_PIN   6
 

I2C configuration

These values configure which CC2538 pins to use for the I2C lines, exposed over JP6 connector, also available as testpoints T2 (PC2) and T3 (PC3).

The I2C bus is used for the RTC on MS1/MS2 and is shared with the on-board TMP102. The I2C is exposed on the east port. Due to pin limitations, no interrupt pin is exposed.

#define I2C_SCL_PORT   GPIO_C_NUM
 
#define I2C_SCL_PIN   3
 
#define I2C_SDA_PORT   GPIO_C_NUM
 
#define I2C_SDA_PIN   2
 
#define I2C_INT_PORT   (-1)
 
#define I2C_INT_PIN   (-1)
 
#define I2C_INT_VECTOR   (-1)
 

CC1200 configuration

These values configure the required pins to drive the CC1200 These pins are exposed on the east port but their use for anything else should be avoided.

#define RADIO_SPI_CLK_PORT   SPI0_CLK_PORT
 
#define RADIO_SPI_CLK_PIN   SPI0_CLK_PIN
 
#define RADIO_SPI_MOSI_PORT   SPI0_TX_PORT
 
#define RADIO_SPI_MOSI_PIN   SPI0_TX_PIN
 
#define RADIO_SPI_MISO_PORT   SPI0_RX_PORT
 
#define RADIO_SPI_MISO_PIN   SPI0_RX_PIN
 
#define RADIO_SPI_CSN_PORT   GPIO_B_NUM
 
#define RADIO_SPI_CSN_PIN   5
 
#define RADIO_RESET_PORT   GPIO_C_NUM
 
#define RADIO_RESET_PIN   7
 
#define RADIO_GPIO0_PORT   GPIO_B_NUM
 
#define RADIO_GPIO0_PIN   4
 
#define RADIO_GPIO2_PORT   GPIO_B_NUM
 
#define RADIO_GPIO2_PIN   0
 
#define CC1200_SPI_INSTANCE   0
 
#define CC1200_SPI_SCLK_PORT   SPI0_CLK_PORT
 
#define CC1200_SPI_SCLK_PIN   SPI0_CLK_PIN
 
#define CC1200_SPI_MOSI_PORT   SPI0_TX_PORT
 
#define CC1200_SPI_MOSI_PIN   SPI0_TX_PIN
 
#define CC1200_SPI_MISO_PORT   SPI0_RX_PORT
 
#define CC1200_SPI_MISO_PIN   SPI0_RX_PIN
 
#define CC1200_SPI_CSN_PORT   GPIO_B_NUM
 
#define CC1200_SPI_CSN_PIN   5
 
#define CC1200_GDO0_PORT   GPIO_B_NUM
 
#define CC1200_GDO0_PIN   4
 
#define CC1200_GDO2_PORT   GPIO_B_NUM
 
#define CC1200_GDO2_PIN   0
 
#define CC1200_RESET_PORT   GPIO_C_NUM
 
#define CC1200_RESET_PIN   7
 
#define CC1200_GPIOx_VECTOR   NVIC_INT_GPIO_PORT_B
 

Misc Peripheral Control control

These values configure the pins used to control peripherals on the Muntjac and MS1/MS2.

PWR_RADIO_EN is used to control power to the on-board CC1200. PWR_SENSE_EN is used to control sensors/sensor power supplies. RS485_TXEN is used to put the half-duplex RS485 transciever into TX.

#define PWR_RADIO_EN_PORT   GPIO_D_NUM
 
#define PWR_RADIO_EN_PIN   2
 
#define PWR_SD_EN_PORT   GPIO_A_NUM
 
#define PWR_SD_EN_PIN   6
 
#define PWR_SENSE_EN_PORT   GPIO_D_NUM
 
#define PWR_SENSE_EN_PIN   1
 
#define RS485_TXEN_PORT   GPIO_D_NUM
 
#define RS485_TXEN_PIN   0
 

Storage Configuration

These values configure the required pins to drive the built-in flash storage.

The Muntjac has the facility for both a microSD card and an on-board M25P16 2MB flash. Both are connected to SSI1/SPI1.

PA6 is used to disable power to the SD card. The M25P16 is always powered. The control and data lines for the SD card are buffered through a level translator to prevent the SD card drawing (mA +) quiescent current through CSn and the SPI bus.

PB7 is used for SD card presence detection, but can be used for !HOLD on the M25P16 with a hardware modification if required.

#define USD_CLK_PORT   SPI1_CLK_PORT
 
#define USD_CLK_PIN   SPI1_CLK_PIN
 
#define USD_MOSI_PORT   SPI1_TX_PORT
 
#define USD_MOSI_PIN   SPI1_TX_PIN
 
#define USD_MISO_PORT   SPI1_RX_PORT
 
#define USD_MISO_PIN   SPI1_RX_PIN
 
#define USD_CSN_PORT   GPIO_A_NUM
 
#define USD_CSN_PIN   7
 
#define USD_DETECT_PORT   GPIO_B_NUM
 
#define USD_DETECT_PIN   7
 
#define FLASH_CSN_PORT   GPIO_B_NUM
 
#define FLASH_CSN_PIN   6
 
#define FLASH_SPI_INSTANCE   1
 

On-board external WDT

The Muntjac does not feature an on-board external WDT like the RE-Mote.

#define EXT_WDT_PORT   (-1)
 
#define EXT_WDT_PIN   (-1)
 

Device string used on startup

#define BOARD_STRING   "UoS Muntjac platform"
 

Detailed Description

The Muntjac is a platform similar to the Zolertia RE-Mote (CC2538 & CC1200/CC1120) that is pin-compatible with the Zolertia Z1.

The Muntjac was designed by the University of Southampton as part of the Mountainsensing project and is intended to be used with an MS1/MS2 baseboard. The Muntjac includes a TMP102 temperature sensor, M25P16 2MB flash, SD card and dedicated antenna outputs for 868MHz (SMA) and 2.4GHz (U.FL). Unlike the Z1, separate SPI buses are used for the radio and storage.

This file provides connectivity information on LEDs, Buttons, UART and other Muntjac, MS1/MS2 peripherals and sensors. With the Muntjac, D1 and D2 I/O on the MS1/MS2 are not used due to pin count limitations.

This file can be used as the basis to configure other platforms using the cc2538 SoC.