100 Microcontroller Programming Tips

100 Microcontroller Programming Tips

From basic knowledge for beginners to practical tips, 100 Q&A essentials suitable for beginners to master microcontrollers. 1. What are the advantages and disadvantages of C language and assembly language in microcontroller development? Answer: Assembly language is a symbolic language that uses mnemonic symbols to represent machine instructions, making it the closest language to machine … Read more

Common Microcontroller Programming Frameworks

Common Microcontroller Programming Frameworks

What is a framework? A program framework is similar to a file outline or template. Writing a program is like writing an article; without an outline or template, it can be quite cumbersome. Why Have a Framework? To save time and reduce errors. For a specific type of program, the logical structure of the code … Read more

Comprehensive Guide to 80 Microcontroller Programming Examples

Comprehensive Guide to 80 Microcontroller Programming Examples

*Example 1: Use P3 port to light up 8 LEDs in sequence #include<reg51.h> // Include microcontroller register header file / Function: Delay for a certain period of time void delay(void) { unsigned char i,j; for(i=0;i<250;i++) for(j=0;j<250;j++) ; } / Function: Main function void main(void) { while(1) { P3=0xfe; // First light on delay(); // Call … Read more

Some Issues Regarding Stacks in Microcontroller Programming

Some Issues Regarding Stacks in Microcontroller Programming

Wu Jianying Microcontroller Development Board Address Store:【Wu Jianying’s Shop】 Address:【https://item.taobao.com/item.htm?_u=ukgdp5a7629&id=524088004171】 The compiler uses two stacks: one is the hardware stack for subroutine calls and interrupt operations, and the other is the software stack for temporary variables and local variables passed in a stack structure. The hardware stack is allocated starting from the top of the … Read more

Microcontroller Programming Learning Guide

Microcontroller Programming Learning Guide

The learning and application of microcontrollers is rapidly rising in factories, schools, and enterprises. Engineers and technicians who are accustomed to traditional electronics face new challenges. If they cannot learn microcontrollers in a short time, they will inevitably be left behind by the times. Only by bravely facing reality, challenging oneself, enhancing learning, and striving … Read more

Microcontroller Programming Examples Collection (1-30)

Microcontroller Programming Examples Collection (1-30)

*Example 1: Use P3 port to light up 8 LEDs in sequence #include<reg51.h> // Include the header file for microcontroller registers / Function: Delay for a period of time void delay(void) { unsigned char i,j; for(i=0;i<250;i++) for(j=0;j<250;j++) ; } / Function: Main function void main(void) { while(1) { P3=0xfe; // First LED on delay(); // … Read more

9 Major Challenges in Microcontroller Programming

9 Major Challenges in Microcontroller Programming

1. What are the advantages and disadvantages of using C language and assembly language in microcontroller development? Answer: Assembly language is a symbolic language that uses mnemonic symbols to represent machine instructions, making it the closest language to machine code. Its main advantages are low resource usage and high program execution efficiency. However, assembly languages … Read more

Microcontroller Programming Experience Summary

Microcontroller Programming Experience Summary

Using “Software Traps + Program IDs” to Handle PC Pointer Jumps When the CPU is disturbed by external factors, sometimes the PC pointer can jump to another part of the program or to a blank segment. In fact, if the PC pointer jumps to a blank segment, it is relatively easy to handle. Just set … Read more