Mongoose – Sharing on Embedded Web Server/Network Library Usage – 6 (Timer)

Mongoose - Sharing on Embedded Web Server/Network Library Usage - 6 (Timer)

🍁Introduction Timer event callbacks in Mongoose may be used in certain scenarios, such as: Sending heartbeat messages to connected clients Implementing reconnection logic for MQTT or WebSocket clients Regularly uploading telemetry data Regularly checking for software update versions … Its functionality and usage methods should be familiar to everyone, which essentially involves writing a callback … Read more

In-Depth Learning of Microcontroller Development: Using Timers (Part 2)

In-Depth Learning of Microcontroller Development: Using Timers (Part 2)

“ This article introduces the working principle of encoders and explains how to use the STM32 microcontroller’s timer encoder mode.“ 01 — Introduction to Encoders 1.1 What is an Encoder? An encoder is a sensor device that converts physical quantities (such as rotational angle, linear displacement, etc.) into electrical signals, widely used in the following … Read more

STM32 Theory: Timer Encoder Interface, Quadrature Encoder, and Practical Speed Measurement Code

STM32 Theory: Timer Encoder Interface, Quadrature Encoder, and Practical Speed Measurement Code

Timer Encoder Interface This learning note is edited based on the STM32 introductory tutorial by Jiang University on Bilibili, for learning and communication purposes only! Introduction Overview This practical case is essentially the same as the code implementation for counting with a rotary encoder written during the study of external interrupts. Previously, counting was done … Read more

Understanding Timers and Interrupts in 51 Microcontrollers: Making LEDs Blink Without Errors

Understanding Timers and Interrupts in 51 Microcontrollers: Making LEDs Blink Without Errors

🚩 Have you encountered these pitfalls? You wrote the LED code, but it blinks inconsistently? You want the microcontroller to “blink the light + read the button” simultaneously, but it freezes? Don’t panic—you just need to understand the “timer” and “interrupt,” the two “little helpers” of the microcontroller!! Today, using simple language and a step-by-step … Read more

Smart Lock System Based on STM32: A Classic Introduction and Timer Review

Now we have reached the configuration of the timer and the review of the interrupt demonstration, preparing adequately for the subsequent project.Question:The timer is provided with a clock frequency of 84MHz,please configure a 100KHz PWM waveform with a duty cycle of 30%. How should the timer be configured? Think about it first.First, from the information … Read more

Comprehensive Guide to Mitsubishi PLC Instructions (Practical Version + Examples)

The instruction system of Mitsubishi PLC is very rich, mainly divided intoFX Series (Small) and Q/L Series (Medium to Large). Most of their instructions are similar, but the Q/L series has more advanced instructions. The instruction system of Mitsubishi PLC is very rich, mainly divided intoFX Series (Small) and Q/L Series (Medium to Large). Most … Read more

Python Timer Functions: Three Methods to Monitor Code Performance

The Python timer functions are powerful tools for monitoring code performance. This article will delve into several commonly used timer functions in Python and demonstrate how to use them to measure code execution time through examples. <span>time.perf_counter()</span>: High-Resolution Performance Counter <span>time.perf_counter()</span> function returns a value of a performance counter (in seconds) with the highest available … Read more

A Brief Introduction to the Registration Mechanism in Embedded Software Development

Problem Description One of the most frustrating aspects of using timers is defining flags and hold times. Each time a definition is made, it leads to a proliferation of flags in the interrupt function, and time variables are scattered throughout the program. When attempting to port the code, one hesitates to delete anything. The program … Read more

Differences Between Time and Timer Data Types in Siemens PLC

Core Difference: Time is a data type used to store time values (e.g., 10 seconds); Timer is a functional component used to implement timing logic (e.g., triggering an action after a delay of 10 seconds). Essentially, it is a “device that works with Time values.” The specific differences can be quickly distinguished by two points: … Read more

Quick Start Guide to Microcontroller Development: From Timing Basics to Precise Time Control

Quick Start Guide to Microcontroller Development: From Timing Basics to Precise Time Control

Teaching Objectives 1. Understand and distinguish the concepts of clock cycle, machine cycle, and instruction cycle, which are the foundation of all timing control. 2. Understand timers; the essence of a timer is a counter, and the source of its counting pulses determines its operating mode (timer mode or counter mode). 3. Understand how timer … Read more