文件名称:STM32-SPI
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [C/C++] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 227kb
- 下载次数:
- 2次
- 提 供 者:
- c***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
本例展示了如何实现2个SPI之间的在全双工(full-duplex)模式下通信,通过NSS软件管理,实现了由主向从,接着又从向主发送数据。
在本例程中,设置SPI1和SPI2为8bit数据帧,9Mbit/s传输速率。
在第一阶段,由主SPI1把SPI1_Buffer_Tx发送到SPI2,由从SPI2把SPI2_Buffer_Tx发送到SPI1。传输完成后,通过比较判断传输是否正确。
由于NSS管脚由软件管理,因此,可以在不改变硬件配置的情况下使SPI1由主变从,而SPI2由从变主。在第二阶段,由从SPI1把SPI1_Buffer_Tx发送到SPI2,由主SPI2把SPI2_Buffer_Tx发送到SPI1。传输完成后,通过比较判断传输是否正确。
在STM3210B-LK1上,如果以上4个传输都正确,则亮起LED1(LD4),否则亮起LED2(LD3)。-err
在本例程中,设置SPI1和SPI2为8bit数据帧,9Mbit/s传输速率。
在第一阶段,由主SPI1把SPI1_Buffer_Tx发送到SPI2,由从SPI2把SPI2_Buffer_Tx发送到SPI1。传输完成后,通过比较判断传输是否正确。
由于NSS管脚由软件管理,因此,可以在不改变硬件配置的情况下使SPI1由主变从,而SPI2由从变主。在第二阶段,由从SPI1把SPI1_Buffer_Tx发送到SPI2,由主SPI2把SPI2_Buffer_Tx发送到SPI1。传输完成后,通过比较判断传输是否正确。
在STM3210B-LK1上,如果以上4个传输都正确,则亮起LED1(LD4),否则亮起LED2(LD3)。-err
相关搜索: stm32
spi
stm32
spi
通信
STM32
SPI
DMA
stm32
spi2
stm32
SPI_NSSInternalSoftwareConfig
stm32
spi
dma
SPI-NSS
stm32
spi
nss
stm32
sp
spi
stm32
spi
通信
STM32
SPI
DMA
stm32
spi2
stm32
SPI_NSSInternalSoftwareConfig
stm32
spi
dma
SPI-NSS
stm32
spi
nss
stm32
sp
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Example1
........\cortexm3_macro.h
........\Debug
........\main.c
........\readme.txt
........\settings
........\........\SPI_text1.cspy.bat
........\........\SPI_text1.dbgdt
........\........\SPI_text1.dni
........\........\spi_text1.wsdt
........\........\SPI_text2.cspy.bat
........\........\SPI_text2.dbgdt
........\........\SPI_text2.dni
........\SPI_text1.dep
........\SPI_text1.ewd
........\SPI_text1.ewp
........\spi_text1.eww
........\SPI_text2.dep
........\SPI_text2.ewd
........\SPI_text2.ewp
........\stm32f10x_adc.c
........\stm32f10x_adc.h
........\stm32f10x_bkp.c
........\stm32f10x_bkp.h
........\stm32f10x_can.c
........\stm32f10x_can.h
........\stm32f10x_conf.h
........\stm32f10x_dma.c
........\stm32f10x_dma.h
........\stm32f10x_exti.c
........\stm32f10x_exti.h
........\stm32f10x_flash.c
........\stm32f10x_flash.h
........\stm32f10x_gpio.c
........\stm32f10x_gpio.h
........\stm32f10x_i2c.c
........\stm32f10x_i2c.h
........\stm32f10x_it.c
........\stm32f10x_it.h
........\stm32f10x_iwdg.c
........\stm32f10x_iwdg.h
........\stm32f10x_lib.c
........\stm32f10x_lib.h
........\stm32f10x_map.h
........\stm32f10x_nvic.c
........\stm32f10x_nvic.h
........\stm32f10x_pwr.c
........\stm32f10x_pwr.h
........\stm32f10x_rcc.c
........\stm32f10x_rcc.h
........\stm32f10x_rtc.c
........\stm32f10x_rtc.h
........\stm32f10x_spi.c
........\stm32f10x_spi.h
........\stm32f10x_systick.c
........\stm32f10x_systick.h
........\stm32f10x_tim.c
........\stm32f10x_tim.h
........\stm32f10x_tim1.c
........\stm32f10x_tim1.h
........\stm32f10x_type.h
........\stm32f10x_usart.c
........\stm32f10x_usart.h
........\stm32f10x_wwdg.c
........\stm32f10x_wwdg.h
........\TIMX_TEXT1.C
........\cortexm3_macro.h
........\Debug
........\main.c
........\readme.txt
........\settings
........\........\SPI_text1.cspy.bat
........\........\SPI_text1.dbgdt
........\........\SPI_text1.dni
........\........\spi_text1.wsdt
........\........\SPI_text2.cspy.bat
........\........\SPI_text2.dbgdt
........\........\SPI_text2.dni
........\SPI_text1.dep
........\SPI_text1.ewd
........\SPI_text1.ewp
........\spi_text1.eww
........\SPI_text2.dep
........\SPI_text2.ewd
........\SPI_text2.ewp
........\stm32f10x_adc.c
........\stm32f10x_adc.h
........\stm32f10x_bkp.c
........\stm32f10x_bkp.h
........\stm32f10x_can.c
........\stm32f10x_can.h
........\stm32f10x_conf.h
........\stm32f10x_dma.c
........\stm32f10x_dma.h
........\stm32f10x_exti.c
........\stm32f10x_exti.h
........\stm32f10x_flash.c
........\stm32f10x_flash.h
........\stm32f10x_gpio.c
........\stm32f10x_gpio.h
........\stm32f10x_i2c.c
........\stm32f10x_i2c.h
........\stm32f10x_it.c
........\stm32f10x_it.h
........\stm32f10x_iwdg.c
........\stm32f10x_iwdg.h
........\stm32f10x_lib.c
........\stm32f10x_lib.h
........\stm32f10x_map.h
........\stm32f10x_nvic.c
........\stm32f10x_nvic.h
........\stm32f10x_pwr.c
........\stm32f10x_pwr.h
........\stm32f10x_rcc.c
........\stm32f10x_rcc.h
........\stm32f10x_rtc.c
........\stm32f10x_rtc.h
........\stm32f10x_spi.c
........\stm32f10x_spi.h
........\stm32f10x_systick.c
........\stm32f10x_systick.h
........\stm32f10x_tim.c
........\stm32f10x_tim.h
........\stm32f10x_tim1.c
........\stm32f10x_tim1.h
........\stm32f10x_type.h
........\stm32f10x_usart.c
........\stm32f10x_usart.h
........\stm32f10x_wwdg.c
........\stm32f10x_wwdg.h
........\TIMX_TEXT1.C