Basics of Assembly: Hands-On with General-Purpose Registers

Basics of Assembly: Hands-On with General-Purpose Registers

In the previous article, it was mentioned that in assembly, the content of registers is modified through assembly instructions to control the CPU’s operation. Several classifications of registers were also discussed.Understanding the concepts can be a bit dry, so today we will look at several registers through debugging on a PC, and also modify the … Read more

C Language String Functions: A Guide from Basics to Mastery

C Language String Functions: A Guide from Basics to Mastery

Scan the code to follow Chip Dynamics and say goodbye to “chip” blockage! Search WeChatChip Dynamics The C language does not have a true string type; instead, it uses a character array + ‘\0’ (null character) to represent a string. Thus, <string.h> provides a group of “text wizards” (string functions) to help us manipulate these … Read more

CNC Hardware and Software Development Environment Used in C Language Executors

CNC Hardware and Software Development Environment Used in C Language Executors

CNC hardware used in C language executors (1) The available memory capacity of the macro executor is ((custom soft capacity) – (C language executor capacity)) (2) These display devices are VGA graphic devices. “16 colors”, “256 colors”, and “16 grayscale” refer to the number of colors that can be displayed simultaneously on the screen. Applications … Read more

Cross-Platform Embedded Development Toolchain: PlatformIO

Cross-Platform Embedded Development Toolchain: PlatformIO

Scan to FollowLearn Embedded Together, learn and grow together Introduction PlatformIO is a cross-platform embedded development toolchain that supports over 50 development platforms and more than 2000 development boards. Official resource link (copy to browser to open): https://docs.platformio.org/en/latest/what-is-platformio.html It integrates features such as a build system, library management, debugging tools, and continuous integration, providing embedded … Read more

Method for Analyzing Backtrace Information of ESP32 Crash

Method for Analyzing Backtrace Information of ESP32 Crash

Recently, after upgrading the ESP32 firmware to LVGL 9.2.2 + MicroPython 1.25, previously functioning code began to experience crashes and restarts. At this point, the following error message can be seen: A fatal error occurred. The crash dump printed below may be used to help determine what caused it. If you are not already running … Read more

Top Ten Pitfalls to Avoid in PLC Programming

Top Ten Pitfalls to Avoid in PLC Programming

Click “Industrial Control Lao Xu” to follow me Introduction “Why does my PLC program crash while running?” “Clearly the logic is fine, but the output signals are jumping around?” PLC programming may seem simple, but beginners (and even experienced engineers) often fall into pitfalls due to some detail issues. This article summarizes the ten most … Read more

Special Register Functions Used in MODBUS TCP Communication

Special Register Functions Used in MODBUS TCP Communication

Special register functions used in MODBUS/TCP communication.Used to store the latest error codes SD10130-SD10137 for the built-in Ethernet.Indicator light status displays communication status:When MODBUS communication is functioning normally, both LED indicators will light up. If the LEDs are not lit, check the wiring or the settings and error status of the master and slave stations. … Read more

Debugging RISCV with Soft JTAG v1.2

Debugging RISCV with Soft JTAG v1.2

Due to current software limitations, the RISCV logic cannot share JTAG simultaneously. Therefore, if you want to debug both the logic and RISCV at the same time, you can achieve this through the RISCV’s soft JTAG. Soft JTAG is a software implementation of JTAG using GPIO. Here, we will demonstrate this using the TI60F225 DEMO. … Read more

How to Pass Signals While Debugging with GDB

How to Pass Signals While Debugging with GDB

As the title suggests, let’s get started. First, prepare the program as follows: #include <iostream> #include <csignal> #include <atomic> std::atomic<int> running(1); void signalHandler(int signal) { std::cout << "Received signal " << signal << std::endl; running = 0; } int main() { signal(SIGTERM, signalHandler); while(running.load()) { } std::cout << "End" << std::endl; return 0; } After … Read more

C Language Exercises – Day 12

C Language Exercises - Day 12

01 Read the following program: #include <stdio.h> main() { int i,j, m=55; for(i=1;i<=3;i++) for(j=3; j<=i; j++) m=m%j; printf(“%d\n “, m); } The output of the program is A) 0 B) 1 C) 2 D) 3 Answer: B Explanation: Brief 02 Read the following program: main() { int a=5,b=4,c=3,d=2; if(a>b>c) printf(“%d\n”,d); else if((c-1>=d)==1) printf(“%d\n”,d+1); else printf(“%d\n”,d+2); … Read more