MC56F83769 - Reading SPI Using DMA

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC56F83769 - Reading SPI Using DMA

232 次查看
dino_ct
Contributor I

Hi NXP,

 

I am using MC56F83768 microcontroller and I want to use DMA to read data from SPI0, which is configured as a slave and only receives data. Is there any code example? Also, to set a proper SOURCE in DMAMUX, I need to know DMA request sources (slot numbers) for peripherals, which I couldn’t find in the MC56F83xxx Reference Manual.

 

Thanks

0 项奖励
回复
3 回复数

186 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

You can use any DMA channel to transfer data from SPI0 receiver data reg to memory(array). For example, you use DMA channel 7

 

xiangjun_rong_0-1732529037447.png

For MC56F83xxx, the SPI0 Receiver slot is 12, the SPI1 receiver slot is 14

xiangjun_rong_1-1732529223686.png

 

You can write

*CHCFG7=1<<7|12; //for SPI0 receiver;

*CHCFG7=1<<7|14; //for SPI1 receiver;

 

Hope it can help you

BR

XiangJun Rong

0 项奖励
回复

202 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that the SDK example has the code to use DMA to transfer data  between SPI and memory, if this example uses spi master mode, you can modify the mode from master to slave.

xiangjun_rong_0-1732513453868.png

 

You can download SDK from the website:

https://mcuxpresso.nxp.com/en

Hope it can help you

BR

Xiangjun Rong

 

105 次查看
dino_ct
Contributor I

Hi,

Thanks for your suggestions and apology for some delayed response – I was out of office for a few days.

I looked at driver examples for queud_spi and, actually, they cover both cases: master and slave spi. So, with some ideas from those examples and digging into the microcontroller’s manual, I got it working. I believe I should be all set (for now ).

0 项奖励
回复