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

PSoC™ 5, 3 & 1

Level 4
50 replies posted 25 replies posted 10 replies posted
Level 4


I want to interface a sdcard with the psoc5lp to store data coming in at 1Msps.

I want to do it without using the core (DMA transfers). I would also like to write to a file so that it would be easier to view the data on the laptop and process it further. PSoC creator does have the emFile component. I am unclear as to how to write to a file using DMA while using the emFile component. The emFile example given by PSoC uses the core to write values into a text file. I would like to do that using the DMA. Can someone please point me to some example code and give me some helpful pointers on how to implement this.

1 Solution
Level 9
1000 replies posted 750 replies posted 500 likes received
Level 9


Are you acquiring data using DMA?

If you can, the ping-pong DMA makes a lot of sense for the data acquisition-side.  Since you're probably using the AD4020 with SPI, you can move the 20bit results using DMA.

  • Create two large RAM buffers for your data acquisition.
  • Use two DMA TDs to move the data acquired in a ping-pong configuration.
  • Configure this DMA to provide a interrupt when a TD has completed (this buffer is full).  The next TD will start moving new acquired data into the other buffer.
  • In the ISR, perform a FS_Write() to move this buffered data into a file.  You can use another DMA TD if you want to eliminate CPU overhead for this operation.


"Engineering is an Art. The Art of Compromise."

View solution in original post

27 Replies