Hello! Welcome to Embedic!
This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > Embedded Events > The rules of the microcontroller development process

The rules of the microcontroller development process

Date: 13-05-2021 ClickCount: 128

For the microcontroller this thing, I think no electronic person is unfamiliar, then the microcontroller in the development process what rules need to master it? Today to learn it with embedic.

1. Design the most streamlined system to meet the requirements

Correctly estimate the ability of the microcontroller, know what the microcontroller can do to maximize the potential of the microcontroller is essential for a microcontroller system designer. We should have an understanding that the processing power of a microcontroller is very powerful.

The rules of the microcontroller development process

Early PCs with a CPU (8086) with processing power comparable to the 8051 were able to handle quite complex tasks. The key to the capabilities of the microcontroller lies in the software written by the software designer.

Only by fully understanding the capabilities of the microcontroller can a "redundant" system design not be made. And the use of many peripheral chips to achieve the functions of the microcontroller can achieve. Doing so, that increases the cost of the system, may also reduce the reliability of the system.

2. The use of watchdog

The watchdog circuit is usually a piece of hardware that is updated at regular intervals. Update is generally done by the microcontroller, if the watchdog is not updated in a certain interval, then the watchdog will generate a reset signal to reset the microcontroller again. The specific form of updating the watchdog is mostly to provide a level rising edge to the relevant pins of the watchdog chip or to read and write one of its registers. Using a watchdog circuit will reset the microcontroller when it fails to perform a dead state.

Currently there are a variety of watchdog chips, such as MAXIM's MAX802, MAX813, etc.. Moreover, there are many kinds of microcontrollers with watchdog integrated in itself. An external watchdog is best because it is not dependent on the microcontroller. If possible, the watchdog update program should not be placed in the interrupt or subroutine, but in the main program in principle.

I once met an engineer who was debugging a program that occasionally caused the watchdog to reset when it was running, so he simply cleared the watchdog in a clock interrupt program that interrupts every 10ms. I believe he also knew that the watchdog out of action, but he was not to identify the real cause of this phenomenon. Therefore, I would like to remind everyone: no matter what the reason, never ignore the real cause of system failure. High quality products come from high quality engineers, high quality products create high quality engineers.

3. Make sure the system's reset signal is reliable

This is a very easy to ignore the problem. When you are designing a microcontroller system, you have this concept in your head? What kind of reset signal is reliable? Have you used an oscilloscope to check the reset signal of the product you are designing? What are the possible consequences of an unstable reset signal? Have you ever found that you have designed the microcontroller system, each time after the restart of power, the data become chaotic, and each time the phenomenon is not the same, can not find the law, or sometimes simply do not run, or sometimes into a dead state, and sometimes nothing normal operation? In this case, you should check the reset signal of your system.

Generally in the datasheet of the microcontroller (Datasheet) will mention the requirements of the reset signal needed for the microcontroller. The width of the general reset signal should be: the width and amplitude of the reset level should meet the requirements of the chip, and the requirement to maintain stability.

There is a particularly important point is that the reset level should occur at the same time as the power supply, that is, once the chip is powered on, the reset signal has been generated.

Otherwise, because there is no reset, the value of the registers in the microcontroller for random values, power on the random contents of the PC registers to start running the program, so it is easy to carry out misoperation or enter a dead state.

4. Make sure the initialization of the system is effective

The start of the system program should be delayed for a period of time. This is a common method in many microcontroller program design, why?

Because the system of the chip and the device from the power on to the normal working state often have a period of time, the start of the program delayed for a period of time, is to allow all the devices in the system to reach a normal working state.

Exactly how much delay is considered appropriate? It depends on the time of each chip in the system to reach the normal operating state, usually the slowest prevails.

Generally speaking, a delay of 20-100 milliseconds is sufficient. For the system using embedded MODEM and other "slow" type of device, it should be longer. Of course, this all needs to be adjusted in the actual operation of the system.

The rules of the microcontroller development process

5. Power on the system to detect

Power-on detection of the system is a good design in the microcontroller program. In the hardware design should also be carefully considered to each chip used, the interface is designed to be easy to use the software to test the model.

Many experienced microcontroller designers will be in the system power on (especially the first power on) for a comprehensive test, or go further, the system's operating state into a test mode and normal operation mode, by adding a test mode to the system for detailed testing, making the system more convenient and easy to batch testing.

It is also important to note that a simple and clear fault display interface is also quite thoughtful.

For example, the system's external RAM (data memory) is a common device in microcontroller systems. If there is a problem with the external RAM, the program usually becomes a wild horse. Therefore, EDA365 Electronic Forum reminds everyone that the program must be tested for external RAM at startup (at least at the first power-up startup).

6.The testing includes

Detecting the cells in the RAM. This is mainly done by writing and reading data to keep consistent.

Testing the address data bus between the microcontroller and the RAM. The bus is not shorted to each other, nor is it connected to "ground".

In addition, many chips, are provided with a test method. For example, the serial communication chip UART has the function of loop test.

7. EMC design

EMC testing requirements have become a necessity for the product.

8. Use Small mode compilation as much as possible

Compared to Large mode and Compact mode, Small mode generates more compact code.

In Small mode, the C51 compiler places variables that do not use keywords such as idata, pdata, xdata special declarations in the data cell. In programming, for data areas that are in, you can specify that they be placed in external memory.

  • STM32 variables are stored in the specified location in the on-chip FLASH
  • Introduction to Ethernet, IP, TCP, HTTP

Hot Products

  • ADSP-BF512BSWZ-4F4

    Manufacturer: Analog Devices

    IC DSP 16/32B 400MHZ LP 176LQFP

    Product Categories: DSP



  • ADSP-BF514KSWZ-4F4

    Manufacturer: Analog Devices

    IC DSP 16/32B 400MHZ LP 176LQFP

    Product Categories: DSP



  • PIC16C716-04/P

    Manufacturer: Microchip


    Product Categories: 8bit MCU



  • EFM32JG1B200F128GM48-C0

    Manufacturer: Silicon Labs


    Product Categories: 32bit MCU



Customer Comments

  • Looking forward to your comment

  • Comment

    Verification Code * 

Compare products

Compare Empty