SPI to Memory transfer (PGDMA)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User12977
Level 1
Level 1
Hi,

I'm trying to read the input from an SPI interface trough GPDMA to the memory of an XMC4800.

In detail:
With a high PWM interrupt frequency (PWM > 750kHz) I'm sampling the SPI interface.
On every interrupt when the frame length of the SPI input is reached (18bit), I want to shift the SPI FIFO to the memory over the GPDMA.

In the attachment file there are some details about the protocol:
Channel 0: PWM Interrupt pin --> ADC starts convertsation at high edge
Channel 1: MOSI
Channel 2: CLK (about 72MHz)
Channel 3; MISO --> Data from ADC 18bit
2737.attach

How do I achieve this?
Some GPDMA example for Dave 4 (peripheral to peripheral , memory to peripheral and vice versa) would help alot.


Thanks
Patrick
0 Likes
2 Replies
lock attach
Attachments are accessible only for community members.
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Find attached an example.
The examples uses a double buffer that will allow you to process the ADC results while others are being gathered.
For that the DMA is configured using a linked list.
The SPI frame length is setup to 18bits.
The receive events are used as triggers for the DMA.

Regards,
Jesus
0 Likes
User12977
Level 1
Level 1
Hi,

Thanks for the files and information.
I have tested the application.
There is one problem, that the data is not sent at end of frame. It is sent at end of word as you can se en the screenshot.
2796.attach

Is there a way to change that?

Thanks
Patrick
0 Likes