Download Print this page
Infineon SPI DMA 1 Manual

Infineon SPI DMA 1 Manual

Spi data communication via dma, aurix tc2xx microcontroller training

Advertisement

Quick Links

SPI_DMA_1
SPI data communication via DMA
AURIX™ TC2xx Microcontroller Training
V1.0.0
Please read the Important Notice and Warnings at the end of this document

Advertisement

loading

Summary of Contents for Infineon SPI DMA 1

  • Page 1 SPI_DMA_1 SPI data communication via DMA AURIX™ TC2xx Microcontroller Training V1.0.0 Please read the Important Notice and Warnings at the end of this document...
  • Page 2: Scope Of Work

    › DMA channel 3 is configured as SPI slave Tx › DMA channel 4 is configured as SPI slave Rx An LED is used to signal the successful data communication. 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 3 The DMA module channels can be configured to transfer data from/to QSPI FIFOs to/from internal RAM Memory without any CPU intervention. › This example is based on the Infineon Low Level Drivers to demonstrate SPI Master Slave Communication with minimum CPU intervention. 2020-01-17...
  • Page 4: Hardware Setup

    Hardware setup This code example has been developed for the board KIT_AURIX_TC297_TFT_BC-Step. 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 5 P02.4 : 17 : SLSI_A P15.2 : 31 : SLSO_0  P02.5 : 18 : MRST P15.4 : 33 : MRST_A  P02.6 : 19 : MTSR_A P15.5 : 34 : MTSR 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 6 Afterwards, the following parameters are modified to enable the DMA usage, set its channels, interrupt priorities and IO port pins: – DMA configuration: dma.useDma, dma.txDmaChannelId, dma.rxDmaChannelId – Interrupts configuration: base.txPriority, base.rxPriority, base.erPriority, base.isrProvider – Pins configuration: pins 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 7 Afterwards, the following parameters are modified to enable the DMA usage, set its channels, interrupt priorities and IO port pins: – DMA configuration: dma.useDma, dma.txDmaChannelId, dma.rxDmaChannelId – Interrupts configuration: base.txPriority, base.rxPriority, base.erPriority, base.isrProvider – Pins configuration: pins 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 8 The function IfxQspi_SpiMaster_initChannel() is used to initialize the QSPI master channel › Finally, the buffers used by the QSPI master are initialized The functions needed to initialize the QSPI Master can be found in the iLLD header IfxQspi_SpiMaster.h. 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 9 SPI Slave transmit interrupt ISR_dma_ch3() ISR calls the function: – IfxQspi_SpiSlave_isrDmaTransmit() – SPI Slave receive interrupt ISR_dma_ch4() ISR calls the function: – IfxQspi_SpiSlave_isrDmaReceive() › The functions listed above can be found in the iLLD headers IfxQspi_SpiMaster.h and IfxQspi_SpiSlave.h 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 10 IfxQspi_SpiMaster_exchange() › Poll for SPI slave data reception using the function: IfxQspi_SpiSlave_getStatus() › The received and transmitted data are compared byte by byte and the number of errors are counted 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 11 › Additionally, using the debugger, the behavior can be checked: – Add g_qspiDma to Watch window – Check if g_qspiDma.qspiBuffer.spiSlaveRxBuffer g_qspiDma.qspiBuffer.spiMasterRxBuffer are the same as g_qspiDma.qspiBuffer.spiMasterTxBuffer and, respectively, g_qspiDma.qspiBuffer.spiSlaveTxBuffer D110 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 12 More code examples can be found on the GIT repository: › https://github.com/Infineon/AURIX_code_examples › For additional trainings, visit our webpage: › https://www.infineon.com/aurix-expert-training › For questions and support, use the AURIX™ Forum: › https://www.infineonforums.com/forums/13-Aurix-Forum 2020-01-17 Copyright © Infineon Technologies AG 2020. All rights reserved.
  • Page 13 Infineon Technologies in in personal injury. customer’s applications. The data contained in this document is exclusively intended for technically trained staff.