Interpretation of ENC28J60 embedded network interface circuit

Publisher:sokakuLatest update time:2014-12-27 Source: 互联网Keywords:ENC28J60  Embedded Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  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.

Keywords:ENC28J60  Embedded Reference address:Interpretation of ENC28J60 embedded network interface circuit

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

IAR Embedded Secure IP ensures the security of product development and upgrades embedded security solutions
IAR's new security solution makes it easy for embedded developers to embed robust security into existing applications and move directly into production, even at a late stage in the software development process Uppsala, Sweden – April 13, 2023 – IAR, a global leader in embedded developm
[Embedded]
IAR Embedded Secure IP ensures the security of product development and upgrades embedded security solutions
Latest Power Management Articles
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号