Embedded – Timer and External Interrupt Simulated UART

Embedded - Timer and External Interrupt Simulated UART

The following are the general steps and example code for simulating UART (Universal Asynchronous Receiver-Transmitter) communication using timers and external interrupts (taking STM32 as an example, using C language). This method can achieve basic UART communication functionality through software simulation without hardware UART peripherals or when additional UART features are required. #include “stm32f10x.h” // Define … Read more

ARMv8/v9 Generic Timer System Architecture

ARMv8/v9 Generic Timer System Architecture

ver0.1 Introduction In previous articles, we invested significant effort in introducing the hardware and software architecture of the ARM interrupt subsystem, laying the foundation for our further research into virtualization technology. Today, we will discuss a topic that requires a basic understanding of the interrupt subsystem. To fully grasp it, we recommend that everyone read … Read more

Essential Methods for Measuring Program Execution Time in Embedded Programming (Experience-Based)

Essential Methods for Measuring Program Execution Time in Embedded Programming (Experience-Based)

1. Why is it necessary to measure program execution time? Rather than measuring program execution time, it might be more accurate to refer to it as measuring task execution time. The projects we undertake are aimed at achieving specific objectives, thus completing corresponding tasks. Simple projects typically focus on a single task, while more complex … Read more

Efficient Programming of Timer Applications: Code Structure and Optimization Methods in Industrial Control Systems

Efficient Programming of Timer Applications: Code Structure and Optimization Methods in Industrial Control Systems

Click the blue text to follow! Just arrived at the workshop this morning, and the equipment suddenly alarmed and stopped. Checking the fault information: Timer overflow. Our colleague Xiao Zhang scratched his head: “Isn’t it just a timer? Why does it keep having problems?” Many beginners in industrial control encounter similar situations. Today, I will … Read more

Timer Application Development: Methodologies for Building Reliable Industrial Control Systems

Timer Application Development: Methodologies for Building Reliable Industrial Control Systems

Click the blue text to follow! 10 Timer Application Practice: A Decade of Workshop Experience from an Old Electrician A few days ago, Xiao Zhang rushed to me: “Master Li, please help me check, the conveyor belt on production line three keeps stopping and starting, causing us to rework a large batch of products!” I … Read more

Case Study: Timed Polling Program Based on S7-1200 Modbus RTU

Case Study: Timed Polling Program Based on S7-1200 Modbus RTU

For more exciting content, click to follow “PLC Enthusiasts” The Siemens S7-1200 can communicate via Modbus RTU through communication modules, with the PLC serving as the controller, typically acting as the Modbus master. When functioning as a Modbus master, it generally polls parameters from multiple slave devices. This article introduces the timed polling program for … Read more

PLC Basics Tutorial: Case Analysis to Improve Your Practical Skills

PLC Basics Tutorial: Case Analysis to Improve Your Practical Skills

Hello, electronic enthusiasts and automation beginners! Today, we won’t talk in abstract terms; let’s get hands-on with PLC! Don’t be intimidated by the name; actually, PLC (Programmable Logic Controller) is simply a “high-level electric control switch”. However, it is much more complex than the light switch at home and can do many more things. In … Read more

Accurate Delay Methods for 51 Microcontroller

Accurate Delay Methods for 51 Microcontroller

There are generally two methods for implementing precise delays in the 51 microcontroller: one is hardware delay, which requires the use of timers/counters. This method can improve CPU efficiency and achieve precise delays; the other is software delay, which mainly uses loops. 1 Using Timer/Counter for Precise Delay The microcontroller system typically selects an 11.0592 … Read more

Essential Siemens PLC Basic Instructions for Beginners

Essential Siemens PLC Basic Instructions for Beginners

1. Contact and Coil Instructions Programming Principles of PLC Ladder Diagram Language 1. The ladder diagram consists of multiple rungs, each coil can form a rung, and each rung has multiple branches, representing a logical equation; 2. The relays, contacts, and coils in the ladder diagram are not physical but are bits in the PLC … Read more

Understand Siemens PLC Basic Instructions in Seconds

Understand Siemens PLC Basic Instructions in Seconds

1. Contact and Coil Instructions Programming Principles of PLC Ladder Diagram Language 1. The ladder diagram consists of multiple rungs, with each coil forming a rung, and each rung having multiple branches, representing a logical equation; 2. The relays, contacts, and coils in the ladder diagram are not physical; they are bits in the PLC … Read more