微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI WIFI设计交流 > CC3200 SPI CS 片选问题!急急急!

CC3200 SPI CS 片选问题!急急急!

时间:10-02 整理:3721RD 点击:

最近在调试  通过CC3200 SPI  DMA 的方式 进行图像传输,环境主要如下:

1.CC3200 SPI 做为 主,从设备端为一个带有缓存的图像采集模块。

2.传输速率配置为20Mbps, 采用DMA方式接收前端的数据,每次 1024字节数据,假如我们的图像帧大小为30KB,则需要30次DMA才能传输完成一帧数据。

在调试过程中出现的问题:

         SPI CS 片选使能问题,在传输过程中我们按照每次传输1K字节对cs使能进行控制 (cs片选拉低,低有效开始SPI读写,传输完1K后CS片选拉高))。但利用该种方式只能接受到1K字节的数据。但如果我们对CS片选一直使能,则可以接到完整的数据。但几秒后数据错误。请问该种情况下,采用什么方式通过SPI对从设备 进行读写操作?

注:我们有看cc3200的 OV788 的demo,及cc3200 SPI DMA 相关的demo.

参考如下程序

https://github.com/yhpan0613/SimpleLink-CC3200/tree/mainstream_br/example/spi_udma_demo

CC3200 SPI Demo

(Redirected from CC32xx SPI Demo)

Contents

 [hide] 

  • 1 Overview
  • 2 Application details
    • 2.1 Source Files briefly explained
  • 3 Usage
  • 4 Limitations/Known Issues

Overview

      The Serial Peripheral Interface (SPI) is synchronous serial interface the allows full duplex communication with an external SPI compliant Master or slave device. SPI devices operate in master-slave mode, where master initiates the communication, and can operate in two mode 4 wire or 3 wire mode. SPI specifies following four signal:

  • SCLK : Serial clock from Master to Slave
  • MOSI : Serial data from master to slave
  • MISO : Serial Data from slave to master
  • CS  : Chip select(Only in 4 wire mode)

Application details

      The demo application focuses on showing the required initialization sequence to enable the CC3200 SPI module in full duplex 4-wire master and slave mode(s).


Source Files briefly explained

  • main.c - Initializes the SPI module in either master or slave 4 wire mode based on macro
  • pinmux.c - Generated by Pinmux utility to mux out the SPI module signal to chip boundary.
  • uart_if.c - Implements the UART terminal.
  • startup_ewarm.c - Implements interrupt vector table when using IAR ewarm tool chain
  • startup_css.c - Implements interrupt vector table when using CC tool chain

Usage

  • Interconnect two LP board as shown below, where one LP board acts as SPI master and other as SPI slave.
LP 1 PinLP 2 PinSignal Name
P1.7 P1.7 SCLK
P2.3 P2.3 CS
P2.6 P2.6 MOSI
P2.7 P2.7 MISO
P2.1 P2.1 GND
  • Setup a serial communication application (HyperTerminal/TeraTerm) with following settings for both the LP(s). For detail info visit Terminal setup

   - Port: Enumerated COM port
   - Baud rate: 115200
   - Data: 8 bit 
   - Parity: None
   - Stop: 1 bit
   - Flow control: None

  • Run the application (by flashing the bin/IAR/CCS) on both the LPs, one compiled for master mode and another for slave mode by changing the following macro definition:
   //*****************************************************************************
   //
   // Appplication Master/Slave mode selector macro
   //
   // MASTER_MODE = 1 : Application in master mode
   // MASTER_MODE = 0 : Application in slave mode
   //
   //*****************************************************************************
   #define MASTER_MODE      0

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top