This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP432P401R
Hello,
I want to transfer some data from RAM to one of the SPI interfaces, which is connected to a DAC.
The DAC expects 16 bits without de-asserting the CS line in between. Currently I generate the CS line manually with a GPIO pin.
To speed up the whole process, I want to use a DMA transfer.
My question (before starting to dig into the DMA documentation in more depth):
- Is is possible to transfer 16 bit words (2 byte sequence) to a SPI interface with DMA and automatically create the correct CS signal (asserted/de-asserted before/after a 2-byte transfer)?
- Could I use a second DMA channel to generate the CS signal?
Any hint and help is very welcome!
BR, Andreas
Hi Andreas,
1. Study theory of ARM's DMA. At least TI's 'slau356' documentation section 11.
2. Use DMA's Scatter-Gathering mode in such steps:
a. Dessert-assert CS using bit-banding.
b. Send fist byte of word
c. Send second byte of word
As you can guess, the CPU intervention is not needed for SYNC procedure, which is great.
Regards,
Alexey
@Alexey & Chris: Very very helpful hints, thank you very much. I will post another reply when I have the PCM output working with DMA (together with a MP3 decoder [libmad], which is working already nicely with a interrupt-driven PCM output).
Just another short question: When writing to a OUT Register of some GPIO port, DMA works without problems.
When I try to write to the corresponding bit-band alias address, nothing happens. Is there anything special to consider when writing to bit-band areas via DMA?
Also CCS does not offer to change the bit-band areas manually. When I display the address 0x42000000 in the memory browser, no content is shown...
Hello,
using a scatter-gather DMA sequence I am now able to write out 16-bit halfwords via SPI and generate the correct CS signal. My program still has a IRQ-routine which is called 44100 times per second (initially I was hoping that I could write a whole block of data via DMA..), but this routine is of course much faster because I only have to trigger the DMA transfer instead of sending the 2 bytes via SPI 'manually'.
Thanks again for the great support!
BR, Andreas
**Attention** This is a public forum