1. Watchdog principle
Watchdog is essentially a timer. The timer counts the clock. When the timer overflows, a reset signal is generated to reset the entire system. In a program or embedded system, the watchdog timer needs to be reset and re-counted regularly. The timer will not overflow and reset the system, thus ensuring the normal operation of the system. When some reason (such as interference) causes the program to run away or enter an infinite loop, the program cannot reset the watchdog timer regularly, and the count overflow generates a reset signal, causing the system to reset.
Suppose the time for a complete running cycle of the system program is T1, the timing cycle of the watchdog is T2, T2>T1, and the count value of the timer is modified after the program runs for one cycle. As long as the program runs normally, the timer will not overflow. If the program "runs away" or enters an infinite loop, the system cannot modify the count value of the time at T1, and keeps counting until it overflows at T2, triggering a system reset and making the system run again, thereby playing a monitoring role.
From the above explanation, it can be seen that the role of Watchdog is to prevent the system from accidentally "running away" and causing the entire system to crash, and to restore (reset) the system operation.
2. S3C2410 watchdog control
1) Used as a regular timer and can generate interrupts
2) Used as a watchdog timer, it can generate a reset signal of 128 clock cycles when it expires
Specifically, see the figure below: the input clock is PCLK (the clock frequency is equal to the main frequency of the system), which undergoes two levels of frequency division (Prescaler and frequency division factor), and finally the divided clock is used as the input clock of the timer. When the counter expires, an interrupt or reset signal can be generated.
The calculation formula of the watchdog timer count value is as follows:
1) The clock cycle input to the counter
t_watchdog = 1/( PCLK / (Prescaler value + 1) / Division_factor )
The values of the prescaler and the division factor are set by the user in WTCON (watchdog clock control register).
2) Watchdog timing cycle
T = count value (WTCNT initial value - WTCNT current value) * t_watchdog
WTCNT is the watchdog data register, which is used to set the number of clock cycles to count. Multiplying by the clock cycle is the total timing time.
Previous article:S3C2410 Memory Expansion (1)——SDRAM
Next article:About S3C2410 memory
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- Apple faces class action lawsuit from 40 million UK iCloud users, faces $27.6 billion in claims
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- The US asked TSMC to restrict the export of high-end chips, and the Ministry of Commerce responded
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- Some predictions about the national competition questions - about power supply questions
- RFID low frequency and high frequency antenna technology
- First look at Texas Instruments' C2000 series
- What is UWB and why is it in my phone? Ultra-wideband technology, explained
- Can the TF card that comes with SensorTile.box be used?
- EEWORLD University ---- 3D TOF Robot: Obstacle Detection, Collision Avoidance and Navigation
- 【Aigtek Instrument Peripherals】Do you know how to use a dotting machine?
- PADS----ECO problem, as shown in the picture, what is the cause? Please tell me if you know, thank you
- How terrible is it that an electric motorcycle battery explodes?
- Is there any official routine for developing EFM8 in Simplicity Studio? Where can I download it?