cancel
Showing results for 
Search instead for 
Did you mean: 

spi transmit without mcu control

ctc.ctc
Associate II
Posted on January 20, 2017 at 06:22

I'm learing stm32 spi,

In normal way of master mode, 

I have to low the slave select pin, then transmit data, then high the slave select pin

I know that I can use dma to transmit data,

but I am not sure that dma can control slave select pin or not?

Can I have anyway to to whole transmit data(including control slave select pin) using all hardware?

#dma #stm32 #spi
4 REPLIES 4
S.Ma
Principal
Posted on January 20, 2017 at 08:56

For Master SPI mode, NSS can be done by SW GPIO, then DMA (TX to send data and generate clocks, RX to receive data) for 1 or multiple blocks of data. This will generate a high throughput with no delay between bytes.

Posted on January 20, 2017 at 11:21

thank you, but one thing I still not sure is that

is there any way to high NSS after dma trasmit finished

(in some situation cpu is too busy, and it's not suitable for using interrupt handler to high NSS)

Posted on January 23, 2017 at 10:51

Hello

ctc.ctc

‌,

Enabled theNSS pulse mode (NSSP=1), this can force the NSS HW to high between data.You may refer to the SPI section in the reference manual related to your device which help you to have more clarification about SPI communication.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Keith Folske
Associate II
Posted on January 26, 2017 at 02:44

You may want to be careful when using NSS pulse mode.  I had attempted this same thing but found that NSS was pulsed high between the address and data phases of read commands.  This resulted in the slave device being de-selected and therefore not responding to the read because it's address state machine had been reset.