The Ethernet interface implementation scheme based on ENC28J60 is designed, and the design method of the hardware architecture of the system is described. On the basis of briefly introducing the structure, function and peripheral circuit of Ethernet controller ENC28J60, the SPI communication between ENC28J60 and Atmega16 is explained. This scheme is not only low-cost, but also can achieve a transmission rate of more than 500Kbps, meeting the Internet control requirements of embedded systems.
Application of ENC28J60 in Embedded Network Interface
ENC28J60 can be used to form network terminal nodes with different functions, such as network servers, devices with Internet functions, remote monitoring (data acquisition, diagnosis) equipment, etc. Figure 2 shows the hardware circuit schematic diagram of the embedded network interface based on ENC28J60. The circuit has: 2 LED status indicators are mainly used to display the network connection status, including whether PHY conflicts, whether the connection is established, whether data is received, connection speed, duplex mode, etc.; required bias resistor R3 (2kΩ, accuracy is 1%); high-speed LAN electromagnetic isolation module (i.e. RJ45 Ethernet interface). In the application, the physical port of ENC28J60 must be connected to the isolation transformer HR901170A in accordance with the requirements of IEEE802.3 for the physical layer specification, such as the spacing between the RJ45 jack and the isolation transformer should be as small as possible, and the routing of the output and input differential signal pairs should be well isolated.
The main controller in the circuit uses Atmel's ATmega16 microcontroller, which has an advanced RISC (Reduced Instruction Set Computer) structure, 16 kB programmable Flash memory, 512 B EEPROM and 1 kB on-chip SRAM, and has a wealth of peripheral interfaces. Its SPI interface allows ATmega16 to perform high-speed synchronous data transmission with peripherals. In this design, ATmega16 SPI is configured as a master mode, and ENC28J60 is a slave device. The SPI working mode of ATmega16 is set by CPOL and CPHA. According to the SPI read and write timing of ENC28J60, the SPI working mode of ATmega16 should be set to mode 0. ATmega16 achieves synchronization with ENC28J60 by setting the CS pin of ENC28J60 low. The SPI clock is started by the data written to the SPI transmit buffer register. The data transmission order on the SPI MOSI (PB5) pin is controlled by the DORD bit of the register SPCR. When set, the LSB (least significant bit) of the data is sent first, otherwise the MSB (most significant bit) of the data is sent first. We choose to send the MSB first, and at the same time, the received data is transferred to the receive buffer register. The CPU reads the received data from the receive buffer by right alignment. It should be noted that when multiple data need to be read from the ENC28J60, even if the ENC28J60 does not need the data serially output by the ATmega16, a data must be written to the SPI transmit buffer before each data is read to start the SPI interface clock. Since the SPI system has only one buffer in the transmit direction and two buffers in the receive direction, it is necessary to wait until the shift process is completed before writing to the SPI data register when sending; and when receiving data, it is necessary to read the currently received data by accessing the SPI data register before the next byte shift process is completed, otherwise the first data will be lost.
Previous article:The LCD display hardware circuit design of the station announcement system using AT89C51
Next article:Design of serial communication circuit between MCS251 and PC
Recommended ReadingLatest update time:2024-11-23 13:44
- Popular Resources
- Popular amplifiers
- Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Viewpoint Comparison, and Real-time Performance
- Machine Learning and Embedded Computing in Advanced Driver Assistance Systems (ADAS)
- Intelligent program synthesis framework and key scientific problems for embedded software
- arm_embedded_machine_learning_design_dummies_guide
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- Vicor high-performance power modules enable the development of low-altitude avionics and EVTOL
- Bourns Launches Two Thick Film Resistor Series with High Power Dissipation Capabilities in Compact TO-220 and DPAK Package Designs
- Bourns Launches New High-Pulse Brake Resistor Series with Superior Energy Dissipation Capabilities
- Nexperia launches new 120 V/4 A half-bridge gate driver to further improve robustness and efficiency in industrial and automotive applications
- Vishay's New 150 V MOSFETs Offer Industry-Leading Power Loss Performance
- The first generation of SGT MOSFET series from Qiangmao: innovative trench technology, automotive-grade 60 VN channel, breakthrough in high-efficiency performance of automotive electronics
- DC/DC Power Supplies for Automotive Applications
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- PCB electromagnetic compatibility wiring and shielding design specifications
- Knowledge about non-synthesizable statements in FPGA
- Optimizing Receiver Performance with Error Vector Analysis
- LIS25BA configuration on STM32F4
- [NXP Rapid IoT Review] +② NXP Rapid IoT Online Programming Preparation
- SH69P42 OTP 4-bit MCU with SAR 8-bit AD converter
- Application Note for Phase shifter, PS-MCM-1.9G
- This week's highlights
- Design of distributed battery intelligent node
- Preheating bath water tank water level controller