XDK API  27.00
XDK Extension Bus User Guide

General Information


The extension bus allows the implementation of additional functionality to the XDK main board, like radios or sensors. This way, developers can use the hardware and software of XDK for testing out new components with minimal application effort.

Note
Extension bus documentation updated as per the XDK user Guide documentation section 4.2.5 Errata. This Documentation is applicable for XDK Gateway V1.0 extension board

Extension header pin assignment

Please find the mapping of the XDK extension connector in the following table.

pin on connector pin on MCU Suggested Usage Macro
A1 PA0 Timer0 compare operations EXTENSION_TIM0_CC0
A2 PC0 Timer0 compare operations EXTENSION_TIM0_CC1
A3 PC1 Timer0 compare operations EXTENSION_TIM0_CC2
A4 PC2 Timer0 Dead time insertion operations EXTENSION_TIM0_CDTI0
A5 PC3 Timer0 Dead time insertion operations EXTENSION_TIM0_CDTI1
A6 PC4 Timer0 Dead time insertion operations EXTENSION_TIM0_CDTI2
A7 PC8 Timer2 Capture operations EXTENSION_TIM2_CC0
A8 PC9 Timer2 Capture operations EXTENSION_TIM2_CC1
A9 PC10 Timer2 Capture operations EXTENSION_TIM2_CC2
A10 PD6 ADC0 operations EXTENSION_ADC0_CH5
A11 PD5 ADC0 operations EXTENSION_ADC0_CH6
A12 PA1 General purpose I/O EXTENSION_GPIO_IN_OUT_0
A13 PE2 General purpose I/O EXTENSION_GPIO_IN_OUT_1
B1 PB9 UART1_TX operations EXTENSION_UART1_TX
B2 PB10 UART1_RX operations EXTENSION_UART1_RX
B3 PB2 UART1_RTS operations EXTENSION_UART1_RTS
B4 PF6 UART1_CTS operations EXTENSION_UART1_CTS
B5 PB4 US2 MOSI operations EXTENSION_US2_MOSI
B6 PB3 US2 MISO operations EXTENSION_US2_MISO
B7 PB5 US2 clock operations EXTENSION_US2_SCK
B8 PD8 US2 chip select EXTENSION_US2_CS
B9 PB11 I2C1 data line EXTENSION_I2C1_SDA
B10 PB12 I2C1 clock line EXTENSION_I2C1_SCL
B11 2V5 Power Limit 100mA continuous/ peak -
B12 3V3 Power Limit 100mA continuous/ peak -
B13 GND Power -

The extension bus connector of XDK is a 26-pin male connector of type ERNI Male 054595. For your extension boards, please use the same connector and use the flat ribbon cable to connect your extension board to XDK.

The MCU pins refer to the Giant Gecko microcontroller on the XDK. For details on the configuration, please refer to the MCU datasheet and MCU Reference Manual.

Warning
I2C1 data pin (PB11) and I2C clock pin (PB12) have an internal pull up resistor of 3.32k and hence cannot be used as GPIO.
Note
Any pin that you want to use will have to be configured accordingly. Please refer to the GPIO and PTD modules for doing so. All pins are assigned with default modes and values in file xdk110/HWconfig/HW_XDK_v1/PDC_pinDefaultConfig\PDC_pinDefaultConfig_cc.c. Please refer to the code for further information.

Software example

This example outlines, how to realize LED blinking functionality on the XDK Extension Bus.

void extensionLedTask(void)
{
/* initialize local variables */
int count = 0;
const TickType_t xDelay = 1000; /* portTICK_PERIOD_MS */
/* Initialization activities for PTD driver */
/* Set the mode and value for a GPIO pin */
/* blinking functionality */
while(count < 10)
{
/* Set data out register for the pin to 1 */
vTaskDelay( xDelay ); // use suitable delay API. This delay API is for demo only.
/* Set data out register for the pin to 0 */
vTaskDelay( xDelay ); // use suitable delay API. This delay API is for demo only.
count++;
}
}

UARTExtensionBus Test

This example outlines, how to configure the UART on the extension bus of XDK.

The following steps are needed to configure in the software after External Hardware setup done.

1) UART1 Module Clock has to be enabled before calling SER_serialInit API as shown in the example below.

2) Initialize the Serial UART init parameters as given in the below example Please note that these structure members hwType,hwDevicePort,protocol and routeLocation values must not to be changed by the user

3) TX buffer size and RX buffer size has to be modified as per the need of the application.Violating this may lead to undesired behaviour

Note
GPIO pin configuration details can be found at "PTD_portDriver_ph.h" under the installed path C:-Workbench\SDK\Common\config\HW_XDK_v1\PTD_portDriver_ph.h.
/* Initializing serial init parameters */
static SER_init_t uartInit =
{
.hwDevicePort = SER_UART1,
.protocol = SER_UART_PROTOCOL,
.baudRate = 115200,
.hasHwFlowControl = false,
.txBuf_p = ser2TxBuf_ma,
.txBufSize = 20,
.rxBuf_p = ser2RxBuf_ma,
.rxBufSize = 20,
.parity = SER_PARITY_NONE,
.dataBits = SER_DATABITS_8,
.stopBits = SER_STOPBITS_ONE,
.routeLocation = SER_ROUTE_LOCATION2,
.txCallback = NULL,
.rxCallback = NULL,
.rtsPort = 0,
.rtsPin = 0,
.rtspolarity = SER_activeLow,
.ctsPort = 0,
.ctsPin = 0,
.ctspolarity = SER_activeLow
};
void ExtensionUARTTask(void)
{
(void) (xTimer);
/* Initialize the local variables */
uint8_t writeBuf[TX_BUFFER_SIZE];
uint8_t readBuf[RX_BUFFER_SIZE];
uint32_t reminingBytes;
/* Enable the UART clock */
CMU_ClockEnable(cmuClock_UART1, true);
/* Set the mode for a GPIO pin for UART control Signals */
/* Initialize the Serial UART with the Configured parameters */
SER_serialInit((SER_device_t*) &uartHandle,(SER_init_t*) &uartInit);
while (1)
{
readBuf[0] = 0; //This buffer is for clearing the previous data
/* Reading back the data form the readbuffer */
SER_serialRead(&uartHandle, &reminingBytes, readBuf, 1);
if (readBuf[0] == 'S') /* Enter character 'S' from the Hterm side */
{
/* Writing some data into the buffer */
sprintf(writeBuf, "Print 'S'for success \r\n");
SER_serialWrite(&uartHandle, NULL, writeBuf, 20);
}
if (readBuf[0] == 'F') /* Enter character 'F' from the Hterm side */
{
/* Writing some data into the buffer */
sprintf(writeBuf, "Print 'F' for failure\r\n");
SER_serialWrite(&uartHandle, NULL, writeBuf, 20);
}
}
}

SPIExtensionBus Test

This example outlines, how to configure the SPI on the extension bus of XDK.

The following steps are needed to configure SPI in the software after External Hardware setup done.

1) Initialize the SPI init parameters as given in the below example Please note that these structure members portNumber and routeLocation values must not to be changed by the user

2) TX buffer size and RX buffer size has to be modified as per the need of the application.Violating this may lead to undesired behaviour

Note
GPIO pin configuration details can be found at "PTD_portDriver_ph.h" under the installed path C:-Workbench\SDK\Common\config\HW_XDK_v1\PTD_portDriver_ph.h.
void ExtensionSPITask(void)
{
/* Initialize local variables */
SPI_initParams_t initParams;
SPI_device_t spiHandle;
uint8_t txBuf[50] = { 0 };
uint8_t rxBuf[50] = { 0 };
uint8_t writeBuf[50] = { 0 };
uint8_t readBuf[50];
/* Set the mode for a GPIO pin for SPI control Signals */
/* Selecting the SPI Port number, Clock mode, Route location and Baudrate */
initParams.portNumber = SPI2; /* SPI port number */
initParams.clockMode = SPI_CLOCK_MODE_CPOL0_CPHA0; /* SPI mode configuration */
initParams.routeLocation = SPI_ROUTE_LOCATION1; /* SPI Route location fixed */
initParams.txBuf_p = txBuf; /* Pointer to the buffer that is to be used as the serial device's holds bytes that are to be transmitted.*/
initParams.rxBuf_p = rxBuf; /* Pointer to the circular buffer that holds the bytes received by the driver */
initParams.txBufSize = 50; /* Capacity in bytes of the transmit buffer */
initParams.rxBufSize = 50; /* Capacity in bytes of the Receive buffer */
initParams.baudrate = 2000000; //here setting the baudrate to 2Mhz
/* Initialize the SPI with valid parameters */
SPI_init(&spiHandle, &initParams);
/* Functionality to explain the write and read with external hardware */
while (1)
{
readBuf[0] = 0; /* This buffer is for clearing the Previous data */
/* Writing some data into the buffer */
writeBuf[0] = 0x80;
/* Enabling the SPI Chip select */
SPI_write(&spiHandle, writeBuf, 1, 1); /* Transmitting the data */
SPI_read(&spiHandle, readBuf, 1); /* Reading the Corresponding data */
/* Disabling the SPI Chip select */
}
}

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Sun Jan 8 2017 02:01:45 by doxygen 1.8.8