Shutdown Procedure¶
Currently, four different shutdown procedures are implemented to enter the various low-power modes.
They are all very similar, but differentiate in some details and between the AMiRo Modules (AMs).
The basic procedure is defined as follows:
- The signals SYS_SYNC_N and SYS_PD_N are both set active.
- first custom operation
- Some GPIO pins are reconfigured as inputs.
This is required, because otherwise a high output could unintentionally power periphery hardware, which is intended to be turned off.
More specifically, these are all signals, which are inputs of hardware that is powered by a regulated power supply voltage.
Whenever the supply is disabled, these elements should be turned off, but if the MCU then drives an input high, it might power up again. - second custom operation
- SYS_SYNC_N is deactivated and each module waits until it is deactivated by all other AMs as well.
- third custom operation
- The board LED (if available) signals "OK" in Morse code (--- -·-).
- All modules enter low-power mode or reset.
As defined in SSSP, the state of SYS_PD_N in the moment when SYS_SYNC_N becomes inactive specifies whether the system will shutdown or restart.
In the following, the four procedures with their particularities for each board are described one by one.
As a matter of fact, the custom operation steps are empty for most AMs.
The only modules, that act somewhat differently are the PowerManagamenet and the DiWheelDrive.
Hence, only these two are addressed in the following.
Transportation¶
PowerManagement¶
- first custom operation
nothing (just proceeding to the next step) - second custom operation
nothing (just proceeding to the next step) - third custom operation
- cutting power
- deactivation of SYS_WARMRST_N
- deactivation of SYS_REG_EN
- deactivation of POWER_EN
- Waits ten milliseconds to make sure, everything is shut down.
- disables all wakeup sources
- disables the WKUP pin
- disables any RTC events
- disables the independent watchdog
- writing information to the backup register
(see Startup Procedure)
- cutting power
At the end of the shutdown procedure, the module enters standby mode.
DiWheelDrive¶
- first custom operation
nothing (just proceeding to the next step) - second custom operation
- cutting power of the motors by setting POWER_EN inactive
- deactivation of all wakeup sources
- deactivation of the WKUP pin
- deactivation of any RTC events
- deactivation of the independent watchdog
- third custom operation
nothing (just proceeding to the next step)
At the end of the shutdown procedure, the module enters standby mode.
DeepSleep¶
PowerManagement¶
- first custom operation
nothing (just proceeding to the next step) - second custom operation
nothing (just proceeding to the next step) - third custom operation
- cutting power
- deactivation of SYS_WARMRST_N
- deactivation of SYS_REG_EN
- deactivation of POWER_EN
- Waits ten milliseconds to make sure, everything is shut down.
- configuration of wakeup sources
Whilst the WKUP pin is enabled explicitly, RTC and independent watchdog are not configured and thus can be initialized by other means. - writing information to the backup register
(see Startup Procedure)
- cutting power
At the end of the shutdown procedure, the module tests whether a power plug is attached.
If so, it restarts and will enter Hibernate mode on startup, else the MCU enters standby mode.
DiWheelDrive¶
- first custom operation
nothing (just proceeding to the next step) - second custom operation
- cutting power of the motors by setting POWER_EN inactive
- configuration of wakeup sources
Whilst the WKUP pin is enabled explicitly, RTC and independent watchdog are not configured and thus can be initialized by other means.
- third custom operation
nothing (just proceeding to the next step)
At the end of the shutdown procedure, the module enters standby mode.
Hibernate¶
PowerManagement¶
- first custom operation
nothing (just proceeding to the next step) - second custom operation
nothing (just proceeding to the next step) - third custom operation
- cutting power
- deactivation of SYS_WARMRST_N
- deactivation of SYS_REG_EN
- deactivation of POWER_EN
- Waits ten milliseconds to make sure, everything is shut down.
- writing information to the backup register
(see Startup Procedure)
- cutting power
At the end of the shutdown procedure, the MCU resets and will enter Hibernate mode on startup.
DiWheelDrive¶
Since the DiWheelDrive can not initiate Hibernate mode (only the PowerManagement can do that), there is no special shutdown sequence for this case.
All particularities for Hibernate mode are handled during startup.
Restart¶
PowerManagement¶
- first custom operation
- Waits one millisecond to ensure, all modules could detect the state of SYS_PD_N.
- setting SYS_PD_N inactive
- Waits another millisecond for the same reason.
- second custom operation
nothing (just proceeding to the next step) - third custom operation
- cutting power
- deactivation of SYS_WARMRST_N
- deactivation of SYS_REG_EN
- deactivation of POWER_EN
- Waits ten milliseconds to make sure, everything is shut down.
- writing information to the backup register
(see startup)
- cutting power
At the end of the shutdown procedure, the MCU will either enter the default low-power mode (DeepSleep) or reset, depending on the state of SYS_PD_N.
DiWheelDrive¶
- first custom operation
- Waits one millisecond to ensure, all modules could detect the state of SYS_PD_N.
- setting SYS_PD_N inactive
- Waits another millisecond for the same reason.
- second custom operation
- cutting power of the motors by setting POWER_EN inactive
- configuration of wakeup sources
Whilst the WKUP pin is enabled explicitly, RTC and independent watchdog are not configured and thus can be initialized by other means.
- third custom operation
nothing (just proceeding to the next step)
At the end of the shutdown procedure, the module enters standby mode.