没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
RK3288 SPI 的相关寄存器详细的介绍和使用 The serial peripheral interface is an APB slave device. A four wire full duplex serial protocol from Motorola. There are four possible combinations for the serial clock phase and polarity. The clock phase (SCPH) determines whether the serial transfer begins with the falling edge of slave select signals or the first edge of the serial clock. The slave select line is held high when the SPI is idle or disabled. This SPI controller can work as either master or slave mode.
资源推荐
资源详情
资源评论






















RK3288 TRM
FuZhou Rockchip Electronics Co.,Ltd. 1498
Chapter 42 Serial Peripheral Interface (SPI)
42.1 Overview
The serial peripheral interface is an APB slave device. A four wire full duplex serial protocol
from Motorola. There are four possible combinations for the serial clock phase and polarity.
The clock phase (SCPH) determines whether the serial transfer begins with the falling edge of
slave select signals or the first edge of the serial clock. The slave select line is held high when
the SPI is idle or disabled. This SPI controller can work as either master or slave mode.
SPI Controller supports the following features:
Support Motorola SPI, TI Synchronous Serial Protocol and National Semiconductor
Microwire interface
Support 32-bit APB bus
Support two internal 16-bit wide and 32-location deep FIFOs, one for transmitting and
the other for receiving serial data
Support two chip select signals in master mode
Support 4, 8, 16 bit serial data transfer
Support configurable interrupt polarity
Support asynchronous APB bus and SPI clock
Support master and slave mode
Support DMA handshake interface and configurable DMA water level
Support transmit FIFO empty, underflow, receive FIFO full, overflow, interrupt and all
interrupts can be masked
Support configurable water level of transmit FIFO empty and receive FIFO full interrupt
Support combine interrupt output
Support up to half of SPI clock frequency transfer in master mode and one sixth of SPI
clock frequency transfer in slave mode
Support full and half duplex mode transfer
Stop transmitting SCLK if transmit FIFO is empty or receive FIFO is full in master mode
Support configurable delay from chip select active to SCLK active in master mode
Support configurable period of chip select inactive between two parallel data in master
mode
Support big and little endian, MSB and LSB first transfer
Support two 8-bit audio data store together in one 16-bit wide location
Support sample RXD 0~3 SPI clock cycles later
Support configurable SCLK polarity and phase
Support fix and incremental address access to transmit and receive FIFO
42.2 Block Diagram
The SPI Controller comprises with:
AMBA APB interface and DMA Controller Interface
Transmit and receive FIFO controllers and an FSM controller
Register block
Shift control and interrupt
T-chip Only

RK3288 TRM
FuZhou Rockchip Electronics Co.,Ltd. 1499
APB
INTERFACE
REGISTER
BLOCIK
DMA
INTERFACE
SHIFT
CONTROL
LOGIC
INTERRUPT
LOGIC
CLOCK
PRE-SCALE
TRANSMIT
FIFO
RECEIVE
FIFO
FSM
CONTROL
APB
BUS
dma_tx_req
dma_rx_req
spi_intr
spi_clk
sclk_out
txd
rxd
dma_tx_ack
dma_rx_ack
ss_in_n
mst_oe_n
ss_0_n
ss_1_n
sclk_in
Fig. 42-1 SPI Controller Block diagram
APB INTERFACE
The host processor accesses data, control, and status information on the SPI through the APB
interface. The SPI supports APB data bus widths of 8, 16, and 32 bits.
DMA INTERFACE
This block has a handshaking interface to a DMA Controller to request and control transfers.
The APB bus is used to perform the data transfer to or from the DMA Controller.
FIFO LOGIC
For transmit and receive transfers, data transmitted from the SPI to the external serial device
is written into the transmit FIFO. Data received from the external serialdevice into the SPI is
pushed into the receive FIFO. Both fifos are 32x16bits.
FSM CONTROL
Control the state’s transformation of the design.
REGISTER BLOCK
All registers in the SPI are addressed at 32-bit boundaries to remain consistent with the AHB
bus. Where the physical size of any register is less than 32-bits wide, the upper unused bits of
the 32-bit boundary are reserved. Writing to these bits has no effect; reading from these bits
returns 0.
SHIFT CONTROL
Shift control logic shift the data from the transmit fifo or to the receive fifo. This logic
automatically right-justifies receive data in the receive FIFO buffer.
INTERRUPT CONTROL
The SPI supports combined and individual interrupt requests, each of which can be masked.
The combined interrupt request is the ORed result of all other SPI interrupts after masking.
T-chip Only

RK3288 TRM
FuZhou Rockchip Electronics Co.,Ltd. 1500
42.3 Function description
SPI Master SPI Slave
clk
cs
txd
rxd
clk
cs
txd
rxd
Fig. 42-2 SPI Master and Slave Interconnection
The SPI controller support dynamic switching between master and slave in a system. The
diagram show how the SPI controller connects with other SPI devices.
Operation Modes
The SPI can be configured in the following two fundamental modes of operation: Master Mode
when SPI_CTRLR0 [20] is 1’b0, Slave Mode when SPI_CTRLR0 [20] is 1’b1.
Transfer Modes
The SPI operates in the following three modes when transferring data on the serial bus.
1. Transmit and Receive
When SPI_CTRLR0 [19:18] == 2‘b00, both transmit and receive logic are valid.
2. Transmit Only
When SPI_CTRLR0 [19:18] == 2‘b01, the receive data are invalid and should not be stored in
the receive FIFO.
3. Receive Only
When SPI_CTRLR0 [19:18] == 2‘b10, the transmit data are invalid.
Clock Ratios
A summary of the frequency ratio restrictions between the bit-rate clock (sclk_out / sclk_in)
and the SPI peripheral clock (spi_clk) are described as,
When SPI Controller works as master, the F
spi_clk
>= 2 × (maximum F
sclk_out
)
When SPI Controller works as slave, the F
spi_clk
>= 6 × (maximum F
sclk_in
)
With the SPI, the clock polarity (SCPOL) configuration parameter determines whether the
inactive state of the serial clock is high or low. To transmit data, both SPI peripherals must
have identical serial clock phase (SCPH) and clock polarity (SCPOL) values. The data frame
can be 4/8/16 bits in length.
When the configuration parameter SCPH = 0, data transmission begins on the falling edge of
the slave select signal. The first data bit is captured by the master and slave peripherals on the
first edge of the serial clock; therefore, valid data must be present on the txd and rxd lines
prior to the first serial clock edge. The following two figures show a timing diagram for a single
SPI data transfer with SCPH = 0. The serial clock is shown for configuration parameters SCPOL
= 0 and SCPOL = 1.
T-chip Only
剩余17页未读,继续阅读
资源评论


Tonyhxy
- 粉丝: 6
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- plc层电梯控制设计方案.doc
- 短肢剪力墙结构分析设计全攻略.docx
- 电气工程及自动化现状与未来发展趋势分析.docx
- 第七章-深基坑降水.ppt
- 物联网医院市场发展趋势分析-新冠肺炎来势凶猛医院面临重重压力互联网.docx
- ±以下结构工程施工程序.doc
- 围堰示意图-Microsoft-Word-文档.doc
- 剪力墙结构住宅楼项目冬季工程施工方案.doc
- 高三-家长会-课件.ppt
- 工程质量检查实用手册基础机房篇》V2.0版.ppt
- 【全国】园林工程施工进度控制.ppt
- 互联网+背景下农产品营销策略.docx
- 软件项目交付清单.doc
- 第2章-孟德尔式遗传分析.ppt
- 2012年9月全国计算机等级考试三级笔试含答案(word).doc
- 球形储罐安装工程施工组织设计.doc
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
