当前位置:网站首页>Gd32f4xx MCU drives MCP2515 to expand can interface

Gd32f4xx MCU drives MCP2515 to expand can interface

2022-06-22 16:20:00 madao1234

1、GD32F4xx SPI

GD32F4xx Series of MCU Only 2 individual CAN Interface , If more CAN Interfaces are mostly used mcp2515 The chip performs SPI turn CAN Interface to use . Let's first introduce GD32F4xx MCU Of SPI peripherals .

1.1 SPI brief introduction

SPI (Serial Peripheral Interface, Serial peripheral interface ), Provides the basis for SPI Data sending and receiving function of the protocol , It can work in master or slave mode .
SPI It's a synchronous data bus , That is, it uses a separate data line and a separate clock signal , To ensure the synchronization between the sender and the receiver . The clock signal tells the receiver to sample the signal on the data line at the exact time . The side that provides the clock signal is called the host (Master), The other side is the slave (slave). In the use of SPI When communication , There is usually only one host , But it can be controlled by multiple slaves . The data acquisition time can be the rising edge or falling edge of the clock signal .

1.2 SPI Pin

Pin name Direction describe
SCK Input / Output host :SPI Clock output ; Slave :SPI Clock input
MISO Input / Output host : Data receiving line ; Slave : Data transmission line
MOSI Input / Output host : Data transmission line ; Slave : Data receiving line
NSS Input / Output Software NSS Pattern ( That is, through other IO The port controls the slave CS Pin ): Don't use ; from
原网站

版权声明
本文为[madao1234]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206221501323766.html