First, power supply is determined.
The role of power supply in embedded systems can be seen as analogous to the role of air in the human body, or even more important: the air we breathe contains oxygen, carbon dioxide, and nitrogen, but in stable concentrations. This is analogous to the various noises in a power supply system. We desire a clean, stable, and compliant power supply, but due to various constraints, this remains merely a dream. This requires attention to two aspects:
a. Voltage
Embedded systems require power supplies of various voltage levels, such as the common 5V, 3.3V, and 1.8V. To minimize power supply ripple, LDO devices are used in embedded systems. Using DC-DC converters would not only result in large sizes, but their ripple would also be a significant problem.
b. Current
The normal operation of an embedded system requires not only a stable and sufficient power supply, but also sufficient current. Therefore, when selecting power supply devices, their load needs to be considered. I generally leave a 30% margin in my designs.
For multilayer boards, the power supply section needs to be split during layout. In this case, pay attention to the splitting path and try to group a certain number of power supplies together. For double-sided boards, the trace width needs to be considered; make it as wide as the board allows. Appropriate decoupling capacitors should be placed close to the power pins.
Second, crystal oscillator determination.
A crystal oscillator is like the heart of an embedded system; its stability directly affects its operating status and communication performance. Common oscillators include passive crystal oscillators and active crystal oscillators. First, you need to determine its oscillation frequency, and then you need to determine the type of crystal oscillator.
a) Passive crystal oscillator
The selection of matching capacitors and resistors is generally based on the reference manual. In microcontroller design, through-hole crystal oscillators are often used in conjunction with ceramic capacitors. In ARM architectures, to reduce space and facilitate wiring, four-corner passive crystal oscillators are often used in conjunction with surface-mount capacitors. Although we are relatively familiar with the matching circuits of fixed crystal oscillators, to ensure everything goes smoothly, it is still necessary to consult the reference manual to determine the capacitor size, whether matching resistors are needed, and other details.
b. Active crystal oscillator
It has a better and more accurate clock signal, but it is more expensive than a passive crystal oscillator, so this is a cost that needs to be considered in hardware circuit design.
When designing circuit boards, it's important to keep crystal oscillator traces as close to the chip as possible, and keep critical signals away from clock traces. If possible, add a grounding ring. For multilayer boards, also keep critical signals away from the crystal oscillator traces.
Third, reserve test I/O ports.
During the embedded system debugging phase, when pin resources are plentiful, I usually reserve one I/O port to connect to an LED or speaker, laying the groundwork for the next step of software development. During the operation of the embedded system, this I/O interface is appropriately controlled to determine whether the system is functioning correctly.
Fourth, external storage devices
An embedded system with a power supply, crystal oscillator, and CPU constitutes the minimum system we are familiar with. If the embedded system needs to run a larger operating system, then not only does the CPU need an MMU, but it also requires external SDRAM and NAND flash memory. If the CPU has its own SDRAM and NAND flash controller, then the use of address lines doesn't require much consideration in the hardware design. If there is no relevant controller, then attention must be paid to the use of address lines.
This part is crucial during layout because it ensures that related signal lines are of equal length to guarantee equal signal delays, including the routing of clock and DQS differential signal lines. Various routing techniques need to be used in combination, such as symmetrical distribution with the CPU, daisy-chain routing, and T-shaped routing. The choice depends on the number of memory modules; generally, the more modules, the more complex the routing. However, understanding the key points makes everything much easier.
Fifth, Functional Interface
The most important aspect of an embedded system is controlling peripheral modules through various interfaces to achieve the designer's intended goals. Commonly used interfaces include serial ports (used to connect Bluetooth, Wi-Fi, and 3G modules), USB interfaces, network interfaces, JTAG interfaces, audio/video interfaces, HDMI interfaces, and so on. Because these interfaces connect to external modules, proper electromagnetic compatibility (EMC) design is crucial. In addition, attention should be paid to the use of differential lines during layout.
Sixth, the screen
This feature is listed separately because it's optional. If an embedded system simply acts as a connector to peripheral modules, connecting to a computer host or directly to a network via relevant interfaces, then a screen is unnecessary. However, if it's a consumer product with frequent user interaction, then it's worth mentioning.
Capacitive touchscreens are the preferred choice for embedded screens, and careful attention must be paid to the layout of the touchscreen and display connection cables in the circuit design. During routing, keep the traces as short as possible and close to the main control CPU, while ensuring that paired signals are routed as differential lines and RGB control signals are routed as equal-length lines. The spacing between various signal traces should follow the 3W rule to avoid mutual interference. In the screen design, it is essential to ensure power consumption and prevent interference to avoid screen flickering and display artifacts.