With the development of microelectronic and computer technology, the design of industrial controller and programmable logical controller are approaching to embedded system and programming is transferring advanced language. Embedded development of industrial controller has been irreversible. After detail market survey, the contract signed between Beijing Tuowei Company Ltd. and Eletronics & Information Laboratory is intended to design embedded industrial controller based on single-chip. Through analyzing a great number of material, AVR single-chip ATmega128 is chosen as CPU of industrial controller. ATmega128 is the most powerful single-chip with Flash memory of 128K bytes, SRAM of 4K bytes and EEPROM of 4K bytes. ATmega128 has boundary scan JTAG port, I2C series port, SPI synchronous series port and general asynchronous series port UART. With appropriate design of peripheral interface circuits, ATmega128 can meet the demand of industrial controller.In the aspects of hardware and software, design of embedded industrial controller based on ATmegal28 use the most popular method of systematic design nowadays. During hardware design, method of micro controller MCU+FPGA(CPLD) is used. The design of interface circuits of micro controller becomes simple and flexible due to using FPGA. EPF10K20 in this system is one of FPGA of Alter FLEXIOK family, which manufactured through CMOS SRAM process combining continuous quick channel interconnection and special embedded array structure.It has the widest application among current Alter PLD elements family, integrating 250,000 gates circuits. Adopting VHDL hardware describing language in MAX+PLUS II developing system, 16 bits high speed counter and input and output controlling circuits of industrial controller are designed in the EPF10K20. uC/OS-â…¡operation system is transplanted into this system to manage the software and hardware projects of this system. Compiling file( OS_CPU_A.ASM) C file relating to processor (OS_CPU.H OS_CPU_C.C)and configuration file (OS_CFGH) are revised so that these files can operate in ATmega128. In order to expand its apphcation range, RS-232 and RS-485 series communication board are designed based on general asynchronous series port of ATmegal28. RS-232 and RS-485 series communication board realized communication among industrial controller, master and industrial controller and achieve networking control.The demands of control of multiple input and output in the conventional PLC are maintained. Processing circuits of input and output are designed specially, which can realize the input of 32 inputting signal and control of 32 outputs. The design of embedded industrial controller based on ATmegal28 is in agreement with the trend approaching of industrial controller to embedded system, possessing great practicality. |