Solutions to communication problems between MCU and ARM series processors

Publisher:devilcoreLatest update time:2014-08-14 Source: eepwKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  1 System Hardware Design

  1.1 Host hardware system structure
Design of motor control system based on ATmegal28

  1) Power supply circuit AT91RM9200 requires 1.8 V and 3.3 V power supplies. In addition, most peripheral devices require 3.3 V power supplies, and a small number of peripheral devices also require 5 V power supplies. Here, the SPX1117M3-3.3 low-dropout (LDO) regulator and SPX1117M3-1.8 low-dropout (LDO) regulator produced by Sipex are selected to provide operating voltage for each device after DC-DC conversion.

  2) Crystal Oscillator Circuit As shown in Figure 2, the crystal oscillator circuit is used to provide working clocks for AT91RM9200 and other peripheral circuits that require clocks. This system uses passive crystal oscillators X1 (18.432 MHz) and X2 (32.768 kHz) as the system's main oscillator and slow clock oscillator, where the 32.768 kHz crystal oscillator provides the system with a slow clock, and the 18 MHz crystal oscillator provides the system with a 180 MHz master clock through frequency multiplication.
Design of motor control system based on ATmegal28

  3) AT91RM9200 processor ATglRM9200 is a high-performance, low-power 16/32-bit RISC microprocessor based on the ARM920T core of Atmel. Its maximum main frequency is 180 MHz. Its bidirectional, 32-bit external data bus supports 8, 16, and 32-bit data widths, and its 26-bit address bus can address a maximum of 64 MB of space. It is the working and control center of the system.

  4) Memory The memory module includes two parts: Flash memory and SRAM memory. Flash memory is used to store boot programs, embedded operating systems, user applications and important data. Even if the power is off, the program and data will not be lost. The design uses 28F640J3A produced by Intel, which has a storage capacity of 64 Mb (8 MB), an operating voltage of 2.7 to 3.6 V, a 48-pin TSOP package, and a 16-bit data width.

  SDRAM memory is the running place of system code, storing programs and data when the system is running, but these programs and data will be lost after power failure. In the design, two SDRAMs with a data width of 16 bits are used in parallel to run as a 32-bit data width SDRAM module.

Design of motor control system based on ATmegal28
The SDRAM circuit used is the HY57V651620BTC from Hynix, which has an operating voltage of 3.3 V, a single-chip storage capacity of 4 groups x 16 Mb, a 54-pin TSOP package, is compatible with the LVTTL level interface, and supports automatic refresh and self-refresh.

  5) The network port uses DAVICOM's DM9161 as the physical layer interface of Ethernet. Through this interface, many physical layer devices can be controlled and configured, status and error information can be obtained, and the working mode and function of the PHY device can be determined. Connect the REF_CLK of DM9161 to the output of 50 MHz crystal oscillator; connect TXD1, TXD2, TXEN, RXD1 and BXD2 of DM9161 to ETXO, ETXI, ETXEN, ERXO and ERXI of AT9lRM9200; connect EXESEN, COL and PWRDWN of DM9161 to high level through 10 kΩ resistors respectively, and connect 6.8 kΩ resistors between BGRESG and BGRES; connect RXEXDV, RXER, RESET, MDC and MDIO of DM9161 to ECRS, ERXER, NRST and EMDIO of AT9lRM9200, and connect light-emitting diodes; connect TX+, TX-, RX+, EMDC, FDX, SPEED and LINKRX of DM9161 to the network isolation transformer.


Design of motor control system based on ATmegal28

  1.2 Slave Hardware Design

  1) ATmega128 MCU ATMEL's AVR MCU is an enhanced RISC microcontroller with built-in Flash, 128 K bytes of in-system programmable Flash (with read capability during writing, i.e. RWW), 4 K bytes of EEPROM, 4 K bytes of SRAM, 53 general I/O lines, 32 general working registers, real-time clock RTC, 4 flexible timers/counters (T/C) with compare mode and PWM function, 2 USARTs, byte-oriented two-wire interface TWI, 8-channel 10-bit ADC (with optional programmable gain), programmable watchdog timer with on-chip oscillator, SPI serial port, JTAG test interface compatible with IEEEll49.1 specification, and 6 power saving modes that can be selected by software. [page]

  2) System Control and Reset All I/O registers are set to initial values ​​during reset, and the program starts executing from the reset vector. The instruction at the reset vector must be an absolute jump JMP instruction so that the program jumps to the reset handling routine. If the program never enables interrupts, the interrupt vector can be overwritten by normal program code.
Design of motor control system based on ATmegal28

  3) When the I/O port is used as a general-purpose digital I/O, all AVRI/O ports have true read-modify-write capabilities. The output buffer has symmetrical drive capabilities and can output or absorb large currents to directly drive LEDs.

  4) SPI serial peripheral interface Serial peripheral interface SPI allows high-speed synchronous data transmission between ATmegal28 and peripherals.

  5) 16-bit timer/counter The 16-bit T/C can realize accurate program timing, waveform generation and signal measurement. The normal mode, CTC mode, fast PWM mode and phase correction PWM mode of T/C1 and T/C3 are the same as those of T/C0 and T/C2.

  2 System Software Design

  The software design of embedded motor control system is divided into host software design and slave software design. The host software design is mainly divided into the host SPI driver and the host communication program.

  From the perspective of program structure, a device driver is a set of I/O device software interfaces composed of related subroutines and data in the kernel. Its task is to provide interface functions to the system. Therefore, each file system or device has its own interface function, which is a fileoperations data structure, and the components in the structure are almost all function pointers. When the kernel needs to perform special operations on a device, it calls the corresponding interface function, that is, the driver routine. This transfers control from the user process to the driver routine, and when the driver routine completes the control returns to the user process. User-mode programs use standard system calls provided by the kernel to communicate with the kernel. When each system call is used, the kernel switches to the corresponding device driver routine for manipulation.

  Calling basic interface functions requires the driver's fileoperations structure member to point to open(), read(), write(), release() and other functions. After implementing the various entry point functions in the xxx_fops structure, write the device driver initialization function and register this function when the kernel starts to complete the initialization settings of the hardware device. The initialization program fragment is as follows:

  void initexxxdevice(viod){

  / Check if the hardware device exists, and if so, initialize the internal registers of the hardware device

  if(result=registerchrdev(254,"xxxdevice",&xxxefops))

  printk("Error: %dinitxxx_device()can\'tgetMajorln", result);

  }

  The function registerchrdev() is called in the device initialization function to complete the character registration. The function form is as follows:

  intregisterchrdev(unsignedintmajor, constchar*name, structfileoperations*fop);

  fops is the operation pointer to the implemented fileoperations structure. Based on these parameters, use the following command to create the device file name under /dev.

  mknod /dev/xxxdevicec2540.
Design of motor control system based on ATmegal28

  3 Conclusion

  Combining advanced computing technology, semiconductor technology and electronic technology with specific applications in various industries and Internet technology has become the development trend of future embedded systems. This system design is an expansion and application of embedded technology and theory, and an upgrade and improvement of the NETCON network control system. It realizes the real-time monitoring of the status of multiple motors in the motor control system, and can control the speed and phase of any motor. It realizes the communication between the microcontroller and the ARM series processor, and solves the problem of low CPU efficiency in motor control using ARM processor. The solution has been tested and applied with good results, greatly improving the CPU efficiency. However, the speed measurement accuracy of the motor needs to be further improved, the PWM speed regulation range needs to be further increased, and the program needs to be further optimized to improve the real-time performance of the entire system.

Keywords:MCU Reference address:Solutions to communication problems between MCU and ARM series processors

Previous article:TI AM335X Power Smart Meter Reading Solution
Next article:Solution for exhaust control system applied to laboratory cabinet

Recommended ReadingLatest update time:2024-11-16 13:46

The usage of array in C language of single chip microcomputer
An array is an ordered collection of data elements of the same type. An array is represented by an array name, and the data in the array is uniquely identified by a specific subscript. The purpose of introducing an array is to use a continuous memory space to store multiple data of the same type to solve the storage
[Industrial Control]
PIC microcontroller disassembly
Preface  Disassembly is not commonly used. But it is common in some industries. For example, when you want to crack encryption algorithms, obtain encryption keys, or when you cannot write a completely consistent program and need to modify some parts, disassembly is essential. Disassembly is boring and challenging. H
[Microcontroller]
Calendar clock based on 51 single chip microcomputer
1 Introduction With the development of microelectronics technology and large-scale integrated circuits, the serial communication application of single-chip microcomputers is constantly deepening. Due to its powerful functions, small size, low power consumption, low price, reliable operation, and convenient use, it is
[Microcontroller]
Calendar clock based on 51 single chip microcomputer
PIC microcontroller controls LED dot matrix display screen
This experiment was simulated using Proteus software. Experimental devices: 20 8X8LED dot matrix display screens, 10 74LS164 shift registers, 10 74LS273 data latches, 2 74LS138 decoders, and 1 PIC16F877A microcontroller. There is no 16X80 dot matrix display screen in the proteus component library, so 20 pieces of
[Microcontroller]
PIC microcontroller controls LED dot matrix display screen
GigaDevice Launches GD32A490 Series Automotive-Grade MCUs
GigaDevice (stock code 603986), an industry-leading semiconductor device supplier, announced today the official launch of the new GD32A490 series of high-performance automotive-grade MCUs. With its advantages such as high main frequency, large capacity, high integration and high reliability, it closely meets th
[Automotive Electronics]
Design of multi-channel accurate delay control system based on single chip microcomputer + CPLD
1 Introduction The control objects in modern control systems may be complex and dispersed, and often work in parallel and independently, but overall they are an organic combination of mutual relevance. Therefore, the timing logic of the control signal requires more precision. CPLD microcontrollers provide techn
[Microcontroller]
Design of multi-channel accurate delay control system based on single chip microcomputer + CPLD
Serial port interrupt mode in 51 single chip microcomputer
        I was recently writing 51's serial port and encountered some problems. After struggling for about ten days, I finally solved it. The serial port receives data in interrupt mode. In a four-layer nested while loop, the serial port data is used in the bottom loop. As a result, the data sent is abnormal. Generally,
[Microcontroller]
Application of PIC microcontroller in household electric heater
Introduction: If household heating is burned with coal, it will pollute the environment and be inconvenient. Therefore, it is necessary to develop an easy-to-use, safe and simple electric controller to automatically control heating. This article introduces the implementation of an electric heater controller with PIC
[Microcontroller]
Application of PIC microcontroller in household electric heater
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号