2014-06-29 08:28 AM
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 #standby2014-06-30 01:09 AM
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 details2014-06-30 03:23 AM
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.2014-06-30 04:04 AM
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 )2014-06-30 04:24 AM
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 hope2014-07-01 11:56 PM
well, it works in stop mode, the SPI is slave so it doesn't matter what the system clock is.