CC254x SPI Driver User Guide

From Texas Instruments Wiki
Jump to: navigation, search

Introduction

This page will describe how to use the SPI ports on the CC254x to interface with an external MCU as a network processor. It will also describe how to update the existing SPI drivers to include support for all 4 of the SPI ports on the CC254x SoC(Currently only 2 SPI ports are implemented in V1.4.)

SPI Interface

The SPI protocol consists of 4 lines – SCLK, DATA, MOSI and MISO. In this system consisting of SPI Master and SPI Slave, there is a requirement for handshake between the master and the slave. Hence, an SRDY pin is used. This is a GPIO input to the master. So, effectively the SPI uses 5 pins to communicate between SPI Master and Slave. CC254xSPIDiagram.PNG

How to apply the patch

Download and unzip the patch to the V1.4 stack directory. File:CC254x SPI driver patch v1.4.zip If prompted, select yes to merge and copy and replace the files to the V1.4 stack directory.

Steps to test the patch

1.Open HostTestRelease project

2.Choose one of the SPI slave configurations in preprocessor definitions

3.Make sure SPI ports are interfaced correspondingly (see tables)

4.Test with another SPI Master

Configurations

There are different configurations to use each of the 4 SPI ports as a slave on the CC254x. This is done by simply changing the HAL_UART_SPI preprocessor definitions.

Compiler options/Preprocessor
  • HAL_UART_SPI == 1
Function Port
MISO P0_2
MOSI P0_3
SS P0_4
SCLK P0_5
SRDY P1_1
  • HAL_UART_SPI == 2
Function Port
MISO P1_7
MOSI P1_6
SS P1_4
SCLK P1_5
SRDY P0_5
  • HAL_UART_SPI == 3
Function Port
MISO P1_4
MOSI P1_5
SS P1_2
SCLK P1_3
SRDY P1_6
  • HAL_UART_SPI == 4
Function Port
MISO P0_5
MOSI P0_4
SS P0_2
SCLK P0_3
SRDY P0_6