cancel
Showing results for 
Search instead for 
Did you mean: 

Wakeup from SPI question

igal
Associate II
Posted on June 29, 2014 at 17:28

I would like to wake up from SPI communication (using the NSS pin).

I have the NSS line connected to both PA0 and the SPI(3) NSS pin.

I would like to wake up from either stop mode or stanby mode (preferably standby mode) while not loosing the data sent to me. is that possible? if so, how?

I'm running STM32F405, at 84MHz.

I know it is possible in other M4 core processor but couldn't figure out how to do it in this one.

Thank you

#wakeup #stop #spi #standby
5 REPLIES 5
chen
Associate II
Posted on June 30, 2014 at 10:09

Hi

''I would like to wake up from either stop mode or stanby mode (preferably standby mode) while not loosing the data sent to me. is that possible? if so, how?''

I do not think it is possible from Standby mode. Wake up from standby, the processor is effectively waking from a reset state, so by the time the SPI peripheral has been re-configured - you would have lost some bytes.

To do it from Stop mode, you can configure PA0 (as you have connected it) as a EXTI.

Please refer to the reference manual for the STM32F4 for details

igal
Associate II
Posted on June 30, 2014 at 12:23

I understand Standby will not work so I stick to Stop mode.

creating EXTI interrupt is not the problem. having the SPI not miss the first byte is.

chen
Associate II
Posted on June 30, 2014 at 13:04

Hi

''creating EXTI interrupt is not the problem. having the SPI not miss the first byte is.''

Yes, indeed.

According to PM0214 - all the peripheral clocks are stopped in 'Stop mode'

So, the question is : how quickly does the peripheral clock re-start on waking?

Does it re-start quickly enough to allow the SPI peripheral to respond to the SPI clock?

It is possible to achieve similar power savings in Sleep mode.

It is possible to stop certain peripheral clocks but leave others enabled in sleep mode.

(refer to the 'peripheral clock enable in low power mode register' in the RCC section of

RM0090 )

igal
Associate II
Posted on June 30, 2014 at 13:24

Not even close. Sleep with all peripheral disabled is 7mA, stop mode is 0.3-0.4mA

I will try maybe configuring SPI to use the internal 16Mhz clock and enable it before re configuring the clock, maybe that will work. I hope

igal
Associate II
Posted on July 02, 2014 at 08:56

well, it works in stop mode, the SPI is slave so it doesn't matter what the system clock is.