Thanh navigation

Chủ Nhật, 6 tháng 4, 2025

Sleep Modes and Power Management

 

  • Idle: light sleep. You may need to switch off other components directly via PRR (coming later) so that the ATmega328P does not wake up unintentionally.
  • ADC Noise Reduction: Even in this mode, many functions remain active. The ADC Noise Reduction Mode, as the name suggests, is also used to reduce noise in analog digital conversions. This allows a higher resolution to be achieved.
  • Power-down: the most energy-saving deep sleep. Only external interrupts, TWI (Two Wire Interface – > I2C) or the watchdog interrupt can wake up the ATmega328P.
  • Power-save: is similar to the power-down mode, but the Timer2 is still awake and could be operated via an external clock.
  • Stand-by: the system oscillator is still running here. This mode is typically chosen when quick waking is necessary. Only six cycles are needed. It is important to know that an external quartz oscillator needs time in the millisecond range to provide a stable system clock.
  • Extended Standby: Compared to the stand-by mode, the Timer2 is active

  • Nguồn: https://wolles-elektronikkiste.de/en/sleep-modes-and-power-management 

     

     

    Thứ Năm, 3 tháng 4, 2025

    Watchdog Timer

    The Hardware Watchdog

    Most chip vendors include an isolated RTL block known as a “Watchdog Timer” in a MCU. This peripheral is comprised of a counter which decrements automatically by the hardware each clock cycle. When the count reaches zero, the hardware will automatically reset the device.

    The peripheral is typically disabled by default and it’s the programmers responsibility to configure and enable it in software. Once enabled, the system software needs to reset the counter periodically to prevent the device from rebooting. This operation is usually referred to as “feeding”, “kicking”, or “patting” the dog. The rationale here is if software is unable to reset the watchdog counter, the system is not running as expected and needs to be reset to get back to a sane state.

    Rources: https://interrupt.memfault.com/blog/firmware-watchdog-best-practices#the-hardware-watchdog

    More resource:

     https://betterembsw.blogspot.com/2014/05/proper-watchdog-timer-use.html

    4. https://www.ablic.com/en/semicon/products/automotive/automotive-watchdog-timer/intro/

    Thứ Tư, 2 tháng 4, 2025