Design scheme for multi-magnetron power control based on S3C2410X processor and microcontroller

Publisher:MengyunLatest update time:2023-01-05 Source: elecfansKeywords:S3C2410X Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Overall design of circuit hardware

The design mainly includes 3 modules: 1. Human-machine exchange module (S3C2410 chip expansion circuit), 2. Power output module (ATmega16L chip expansion circuit), 3. Magnetron working circuit. The human-computer exchange module is mainly used to receive the user's command data and then pass it to the power output module to output a given power. At the same time, it receives the information fed back by the power in the power output module circuit, so that the user can process the corresponding information. The overall framework is shown in Figure 1-1:

Design scheme for multi-magnetron power control based on S3C2410X processor and microcontroller

1.1 Control circuit design based on S3C2410X processor

The control system uses the S3C2410X processor of South Korea's Samsung Semiconductor Company as the main control chip. SBC2410X is a 16/32-bit RISC embedded microprocessor based on the ARM920T core, with high cost performance and low power consumption. Use this chip as the main control chip and expand 64M SDRAM, 64M Nand Flash, 1M Nor Flash, standard serial port, user button, LCD screen interface, JTAG module, and Ethernet interface (as shown in Figure 1-2).

o4YBAGBG8uiALGJMAABxnpH6J9c813.png

1.2 Design of power output circuit based on ATmega16L microcontroller

The slave chip adopts AVR series microcontroller ATmega16L. ATmega16 has rich on-chip resources, including: 16k bytes of online programming, application programming Flash program processor, 512 bytes of EPROM, 1K bytes of SRAM, 32 general-purpose working registers, 32 general-purpose I/O ports, 3 A timer/data counter, 20 interrupt sources, 2 programmable serial ports USART, 15 power-saving modes selected through software.


The master and slave chip modules exchange data through their respective serial ports. Specifically, the main circuit module sends data to the slave chip module, and the slave chip generates corresponding waveforms based on the input data to obtain the corresponding output power. At the same time, the circuit module is collected from the chip application, and the actual power is collected and fed back to the main chip. The main chip hands over the data to the user for management. When necessary, a warning message will be issued to protect the circuit.


2. Driver writing and Linux kernel tailoring

The design uses Linux operating system as the operating platform. Judging from the development process of the Linux system, Linux has been an open system from the beginning and follows the principle of open source code. It is a stable network operating system and has the following advantages as an embedded system.


(1) The open source code of Linux allows anyone to modify its source code. This can reduce development costs, on the other hand it can increase development costs. (2) Linux supports multiple architectures such as X86, ARM, MIPS, and SH, and has been ported to multiple hardware platforms. (3) Linux has a unique kernel module mechanism, which can insert a module into the kernel or remove it from the kernel in real time according to user needs. (4) The Linux system kernel is streamlined, efficient and stable, and can give full play to hardware functions, so it runs more efficiently than other operating systems. (5) Linux is the first operating system to support the TCP/IP protocol stack, and its kernel is very complete in terms of networking.

Because the target environment of embedded development targets a specific operating system, the host/target machine method is used to install the Linux operating system on the PC and establish the cross-compilation environment arm-gcc. Then write specific drivers for the design system hardware, mainly including the driver functions of the display module and serial communication module.


2.1 The liquid crystal display module completes the data drive of the human-computer friendly interface and has the ability to display graphics. A modular approach is used to design the driver program. The content of LCD driver design is as follows:

(1) First, perform necessary initialization on the hardware managed by the driver. (2) Initialize device-related parameters. (3) Register the device in the kernel. The important structures involved are: static struct fb_ops s3c2410fb_ops; (4) Other initialization work. int __init s3c2410fb_init(void); int __init s3c2410fb_setup(char *options).


2.2 Serial port communication is completed. The master chip sends data and commands to the slave chip, so that the slave chip completes the waveform output of the port and controls the power of high-power equipment through the output waveform. At the same time, the high-power equipment feeds back the actual power to the slave chip through the measurement circuit, and the slave chip sends data to the main control chip through the serial port to display the correct power data, which is convenient for users to view. Serial port driver design content:

(1) Initialize serial port-related hardware devices. The important structures involved are:

static struct tty_driver normal, callout;

static struct tty_struct *s3c2410_table[UART_NR];

static struct termios *s3c2410_termios[UART_NR];

static struct *s3c2410_termios_locked[UART_NR]。

(2) Register the interrupt service routine. Accept interrupt service routine:

static void s3c2410uart_rx_interrupt(int irq, void *dev_id,,struct pt_regs *regs);

Send interrupt service routine:

static void s3c2410uart_tx_interrupt(int irq, void *dev_id, ,struct pt_regs *reg);

(3) Register the device in the kernel. uart_register_driver(&s3c2410_reg).

(4) Loading and unloading of equipment. module_init(s3c2410uart_init); module_init(s3c2410uart_init).

After designing the hardware driver, tailor the Linux kernel for the control main chip to suit the needs of the control device. Enter the PC Linux operating system, enter the ViVi original code directory, and execute the "make menuconfig" command to start configuring the kernel. After the configuration is complete, execute the "make" command to save ViVi. Burn the ViVi image file into the designed hardware circuit board through JTAG.


Enter the Linux kernel file and execute the "make menuconfig" command to start configuring the Linux kernel file. Select the driver options to be used and configure the kernel according to the actual chip module of the circuit board. Finally, use the "make" command to compile the kernel file. If there is a problem with compilation, you need to modify the kernel file. After successful compilation, download the generated image file to the circuit board through the serial port. ViVi can then start the downloaded kernel file. Kernel design and debugging flow chart 2-1.

o4YBAGBG8vaAH8t2AACZ5e3180Y496.png

3. Main chip control system programming and slave chip programming based on QT

Graphical user interface GUI is the most mature human-computer interaction technology in computer systems so far. Different from desktop systems, embedded GUI has the following characteristics:

* Small size; * Small system resource consumption during runtime; * Upper-layer interface has nothing to do with hardware and is highly portable; * High reliability;

During development, considering that the problem mainly focused on the hardware requirements of the graphical user interface, the final interface provided to the user in the design was simple and practical.


The embedded development platform QT/Embedded provided by TrollTech Company of Norway is used in the design as the software development platform for this design. The platform uses C++ language as the development language, and its core is called the signal and slot mechanism. In the design, the main chip mainly displays data on the LCD module, allowing users to intuitively control the operating status of the device. At the same time, the power set by the user is also sent to the slave chip, so that the slave chip outputs the power waveform. This work can be accomplished using QT's own class QLCDNumber, which inherits many display-related functions. The graphic control layout adopts the QWidget class, and the time calculation and display adopts the QTimer class. In the communication module, the Linux kernel function cfsetispeed() is used to set the baud rate, and the important serial port data structure struct termios Opt is used to set the check bit and stop bit of the serial port accordingly to achieve the purpose of sending and receiving data. Figure 3-1 shows the main chip programming process.


The slave chip uses an interrupt method to receive the data sent by the main chip, and after processing the received data, it outputs a waveform at the port pin, and the waveform generates a suitable power through the output circuit. At the same time, the slave chip continuously receives the current data collected by the acquisition module, processes the data, and then sends it to the main chip through the serial port, which is displayed on the LCD module of the main chip to provide users with monitoring and processing of dangerous signals.

o4YBAGBG8v2ADh57AACUoNAy3D4869.png

4. Joint debugging of software and hardware of the control system

Compile the written main chip program with a cross-compiler to generate binary code, which is downloaded to the main circuit board using the network. At the same time, download the library files and connection files associated with the program to the corresponding location of the Linux kernel on the main circuit board through the network and link them accordingly.


The written slave chip program is compiled with a compiler to generate binary code and burned into the chip's Flash, so that the code is solidified in the chip.


In order to check the accuracy of the design circuit measurement and output, it is necessary to verify the relationship between the given power, the actual power, and the displayed feedback power. The final experiment shows: given power = calculated actual power = displayed feedback power, proving that the designed Linux-based control system can run accurately and the design meets the performance requirements.


5 Conclusion

The designed control system has a friendly graphical operation interface, which is easy and intuitive to operate. The design uses a master and slave chip solution to achieve the advantages of remote control and ensure the safety of the operator's operation.

[1] [2]
Keywords:S3C2410X Reference address:Design scheme for multi-magnetron power control based on S3C2410X processor and microcontroller

Previous article:s3c2410/2440(armv4t) ported to Android
Next article:Implementation of digital north seeker application solution based on S3C2440A and WinCE 4.2 operating system

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号