Note the following details of the code protection feature on Microchip devices:
YSTEM
CERTIFIED BY DNV
== ISO/TS 16949==
•Microchip products meet the specification contained in their particular Microchip Data Sheet.
•Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•Microchip is willing to work with the customer who is concerned about the integrity of their code.
•Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device applications and the like is provided only for your convenience and may be
superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO
REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE,
MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer’s risk, and the buyer agrees to defend, indemnify and hold
harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or
otherwise, under any Microchip intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC, FlashFlex, flexPWR, JukeBlox, K
MediaLB, MOST, MOST logo, MPLAB, OptoLyzer, PIC, PICSTART, PIC
UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
The Embedded Control Solutions Company and mTouch are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net, ECAN, In-Circuit Serial
Programming, ICSP, Inter-Chip Connectivity, KleerNet, KleerNet logo, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK,
MultiTRAK, NetDetach, Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, RightTouch logo, REAL ICE, SQI, Serial
Quad I/O, Total Endurance, TSHARC, USBCheck, VariSense, ViewSpan, WiperLock, Wireless DNA, and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries.
GestIC is a registered trademarks of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in
other countries.
All other trademarks mentioned herein are property of their respective companies.
logo, RightTouch, SpyNIC, SST, SST Logo, SuperFlash and
EELOQ, KEELOQ logo, Kleer, LANCheck,
ISBN: 97816312769251
QUALITY MANAGEMENT S
DS50002332A-page 2Preliminary 2014 Microchip Technology Inc.
Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
Worldwide Sales and Service .....................................................................................37
DS50002332A-page 6Preliminary 2014 Microchip Technology Inc.
EVB-LAN9252-DIG-IO
ETHERCAT® DIG I/O
USER’S GUIDE
Preface
NOTICE TO CUSTOMERS
All documentation becomes dated, and this manual is no exception. Microchip tools and
documentation are constantly evolving to meet customer needs, so some actual dialogs
and/or tool descriptions may differ from those in this document. Please refer to our web site
(www.microchip.com) to obtain the latest documentation available.
Documents are identified with a “DS” number. This number is located on the bottom of each
page, in front of the page number. The numbering convention for the DS number is
“DSXXXXXA”, where “XXXXX” is the document number and “A” is the revision level of the
document.
For the most up-to-date information on development tools, see the MPLAB
Select the Help menu, and then Topics to open a list of available online help files.
®
IDE online help.
INTRODUCTION
This chapter contains general information that will be useful to know before using the
EVB-LAN9252-DIG-IO. Items discussed in this chapter include:
Document Layout
•
• Conventions Used in this Guide
• The Microchip Web Site
• Development Systems Customer Change Notification Service
• Customer Support
• Document Revision History
DOCUMENT LAYOUT
This document describes how to use the EVB-LAN9252-DIG-IO as a development tool for the
Microchip LAN9252 EtherCAT® slave controller. The manual layout is as follows:
• Chapter 1. “Overview” – Shows a brief description of the EVB-LAN9252-DIG-IO.
• Chapter 2. “Board Details & Configuration” – Includes details and instructions for using
the EVB-LAN9252-DIG-IO.
• Chapter 3. “LAN9252 EEPROM Programming”– Includes details and instructions for
programming the LAN9252 EEPROM.
• Appendix A. “EVB-LAN9252-DIG-IO Evaluation Board” – This appendix shows the
EVB-LAN9252-DIG-IO.
• Appendix B. “EVB-LAN9252-DIG-IO Evaluation Board Schematics” – This appendix
shows the EVB-LAN9252-DIG-IO schematics.
• Appendix C. “Bill of Materials (BOM)” – This appendix includes the
Choice of mutually exclusive
arguments; an OR selection
Represents code supplied by
user
®
IDE User’s Guide
“Save project before build”
4‘b0010, 2‘hF1
any valid filename
[options]
errorlevel {0|1}
var_name...]
void main (void)
{ ...
}
DS50002332A-page 8Preliminary 2014 Microchip Technology Inc.
Preface
THE MICROCHIP WEB SITE
Microchip provides online support via our web site at www.microchip.com. This web site is used
as a means to make files and information easily available to customers. Accessible by using your
favorite Internet browser, the web site contains the following information:
• Product Support – Data sheets and errata, application notes and sample programs,
design resources, user’s guides and hardware support documents, latest software releases
and archived software
• General Technical Support – Frequently Asked Questions (FAQs), technical support
requests, online discussion groups, Microchip consultant program member listing
• Business of Microchip – Product selector and ordering guides, latest Microchip press
releases, listing of seminars and events, listings of Microchip sales offices, distributors and
factory representatives
DEVELOPMENT SYSTEMS CUSTOMER CHANGE NOTIFICATION SERVICE
Microchip’s customer notification service helps keep customers current on Microchip products.
Subscribers will receive e-mail notification whenever there are changes, updates, revisions or
errata related to a specified product family or development tool of interest.
To register, access the Microchip web site at www.microchip.com, click on Customer Change
Notification and follow the registration instructions.
The Development Systems product group categories are:
• Compilers – The latest information on Microchip C compilers, assemblers, linkers and
other language tools. These include all MPLAB C compilers; all MPLAB assemblers
(including MPASM assembler); all MPLAB linkers (including MPLINK object linker); and all
MPLAB librarians (including MPLIB object librarian).
• Emulators – The latest information on Microchip in-circuit emulators.This includes the
MPLAB REAL ICE and MPLAB ICE 2000 in-circuit emulators.
• In-Circuit Debuggers – The latest information on the Microchip in-circuit debuggers. This
includes MPLAB ICD 3 in-circuit debuggers and PICkit 3 debug express.
• MPLAB IDE – The latest information on Microchip MPLAB IDE, the Windows Integrated
Development Environment for development systems tools. This list is focused on the
MPLAB IDE, MPLAB IDE Project Manager, MPLAB Editor and MPLAB SIM simulator, as
well as general editing and debugging features.
• Programmers – The latest information on Microchip programmers. These include produc-
tion programmers such as MPLAB REAL ICE in-circuit emulator, MPLAB ICD 3 in-circuit
debugger and MPLAB PM3 device programmers. Also included are nonproduction development programmers such as PICSTART Plus and PIC-kit 2 and 3.
CUSTOMER SUPPORT
Users of Microchip products can receive assistance through several channels:
• Distributor or Representative
• Local Sales Office
• Field Application Engineer (FAE)
• Technical Support
Customers should contact their distributor, representative or field application engineer (FAE) for
support. Local sales offices are also available to help customers. A listing of sales offices and
locations is included in the back of this document.
Technical support is available through the web site at: http://www.microchip.com/support
DS50002332A-page 10Preliminary 2014 Microchip Technology Inc.
1.1INTRODUCTION
The LAN9252 is a 2-port EtherCAT® slave controller with dual integrated Ethernet
PHYs which each contain a full-duplex 100BASE-TX transceiver and support 100Mbps
(100BASE-TX) operation. 100BASE-FX is supported via an external fiber transceiver.
Each port receives an EtherCAT® frame, performs frame checking and forwards it to
the next port. Time stamps of received frames are generated when they are received.
The Loop-back function of each port forwards the frames to the next logical port if there
is either no link at a port, if the port is not available, or if the loop is closed for that port.
The Loop-back function of port 0 forwards the frames to the EtherCAT® Processing
Unit. The loop settings can be controlled by the EtherCAT® master.
Packets are forwarded in the following order:
Port 0 -> EtherCAT® Processing Unit -> Port 1 -> Port 2.
The EtherCAT® Processing Unit (EPU) receives, analyzes and processes the EtherCAT® data stream. The main purpose of the EtherCAT® Processing unit is to enable
and coordinate access to the internal registers and the memory space of the ESC,
which can be addressed both from the EtherCAT® master and from the local application. Data exchange between master and slave applications is comparable to a
dual-ported memory (process memory), enhanced by special functions for consistency
checking (SyncManager) and data mapping (FMMU). Each FMMU performs bitwise
mapping of logical EtherCAT® system addresses to physical device addresses.
The scope of this document is to describe the EVB-LAN9252-DIG-IO setup, which supports a Digital I/O Interface and corresponding jumper configurations. The LAN9252 is
connected to an RJ45 Ethernet jack with integrated magnetics for 100BASE-TX connectivity. A simplified block diagram of the EVB-LAN9252-DIG-IO is shown in
Concepts and material available in the following documents may be helpful when reading this document. Visit www.microchip.com for the latest documentation.
• LAN9252 Data Sheet
• AN 8.13 Suggested Magnetics
• EVB-LAN9252-DIG-IO Schematics
IDE - Integrated Development Environment
ESC - EtherCAT® Slave Controller
EVB - Engineering Validation Board
HAL - Hardware Abstraction Layer
HBI - Host Bus Interface
SPI - Serial Protocol Interface
SSC - Slave Stack Code
DS50002332A-page 12Preliminary 2014 Microchip Technology Inc.
Chapter 2. Board Details & Configuration
2.1POWER
EVB-LAN9252-DIG-IO
ETHERCAT® DIG I/O
USER’S GUIDE
This section includes sub-sections on the following EVB-LAN9252-DIG-IO details:
•Power
• Resets
• Clock
• Configuration
• Mechanicals
2.1.1+5V Power
Power is supplied to the LAN9252 by a +3.3V on-board regulator, which is powered by
a +5V external wall adapter (Manufacturer: TRIAD MAGNETICS and P/N:
WSU050-3000). The LAN9252 includes an internal +1.2V regulator which supplies
power to the internal core logic. Assertion of the D1 Green LED indicates successful
generation of +3.3V output. The SW1 switch must be in the ON position for the +5V to
power the +3.3V regulator.
2.2RESETS
2.2.1Power-on Reset
A power-on reset occurs whenever power is initially applied to the LAN9252 or if the
power is removed and reapplied to the LAN9252. This event resets all circuitry within
the LAN9252. After initial power-on, the LAN9252 can be reset by pressing the reset
switch SW2. The reset LED D2 will assert (red) if when the LAN9252 is in reset condition. For stability, a delay of approximately 180ms is added from the +3.3V output to
reset release.
2.2.2Reset Out
The LAN9252 reset pin can be configured as an output to reset the SoC. The RST# pin
becomes an open-drain output and is asserted for the minimum required time of 80ms.
2.2.3GPIO Reset
The EVB-LAN9252-DIG-IO provides the option to reset the LAN9252 through a PIC
GPIO pin [95(RG14)]. The SW10 switch is used for this selection, as shown in
Ta bl e 2 -1 .
The EVB-LAN9252-DIG-IO utilizes an external 25Mhz 25ppm crystal from Cardinal
Components Inc. (P/N: CSM1Z-A5B2C5-40-25.0D18-F).
2.4CONFIGURATION
The following sub-sections describe the various board features and configuration settings. A top view of the EVB-LAN9252-DIG-IO is shown in Figure 2-1.
FIGURE 2-1:EVB-LAN9252-DIG-IO TOP VIEW WITH CALLOUTS
DS50002332A-page 14Preliminary 2014 Microchip Technology Inc.
Board Details & Configuration
2.4.1Strap Options
2.4.1.1CHIP MODE SELECTION
Table 2-2 details the LAN9252 chip mode configuration straps.
TABLE 2-2:CHIP MODE CONFIGURATION STRAP
HeaderDescriptionPinsSettings
J4,J5,J7,J8 Chip mode configuration strap
inputs. This strap determines
the number of active ports and
port types.
Note:For proper operation, chip mode must be in 2-port mode, where Port 0 =
PHY A and Port 1 = PHY B. This requires J4, J5, J7, and J8 to be
pulled-down (2-3) shorted. All other configurations are not supported by this
EVB.
2.4.1.2EEPROM SIZE CONFIGURATION
The EEPROM size configuration strap (J6 & J9) determines the supported EEPROM
size range. A low selects 1Kbits (128 x 8) through 16Kbits (2K x 8)_24C16. A high
selects 32Kbits (4K x 8) through 512Kbits (64K x 8) or 4Mbits (512K x 8)_24C512.
1-2
Short 1-2 for high (pull-up)
2-3
Short 2-3 for low (pull-down) (default)
TABLE 2-3:EEPROM SIZE CONFIGURATION STRAP
HeaderDescriptionPinsSettings
J6, J9EEPROM size configuration
strap inputs. This strap determines the supported
EEPROM size range.
1-2
Short 1-2 for high (pull-up) (default)
2-3
Short 2-3 for low (pull-down)
2.4.1.3COPPER AND FIBER STRAPS
The LAN9252 supports 100BASE-TX (Copper) and 100BASE-FX (Fiber) modes. In
100BASE-FX operation, the quality of the receive signal is provided by the external
transceiver as either an open-drain, CMOS level, Loss of Signal (SFP) or a LVPECL
Signal Detect (SFF).
This EVB supports 100BASE-TX (Copper) and SFP 100BASE-FX (Fiber) modes. By
default Copper Mode is active. Fiber Mode is supported as an assembly option. To
select the Copper or Fiber Mode, the respective strap and signal routing resister
assembly options must to be configured.
Note:Vendor part number for SFP: Finisar/FTLF1217P2,
Note:The above strap details describe the LAN9252 function. This EVB does not
support SFF Fiber Mode. Therefore, FX-SD related straps are not applicable.
Reference
Volta g e ( V )
Function
Port 1
FX-SD / copper twisted pair for Port 1, further
determined by FXSDB
for Ports 0 and 1, further determined by FXSDA
and FXSDB
2.4.2LED Indicators
The D3 and D4 LEDs are used to indicate the Link/Activity status on the corresponding
EVB ports, as detailed in Table 2-9. The Link/Act LED should be ON at each port when
the cable is present. If the Link/Act LED is not ON, it indicates there is an issue with the
connection or cable.
TABLE 2-9:D3 AND D4 LINK/ACTIVITY LED STATUS INDICATORS
StateDescription
OffLink is down
Flashing GreenLink is up with activity
Steady GreenLink is up with no activity
Additionally, the D5 LED is used as a RUN indicator (green) to shows the AL status of
the EtherCAT® State Machine (ESM), as detailed in Table 2-10.
TABLE 2-10:D5 RUN LED STATUS INDICATOR
StateDescription
OffThe device is in the INITIALIZATION state
Blinking (on 200ms, off 200ms)The device is in the PRE-OPERATIONAL state
Single Flash (on 200ms, off 1000ms)The device is in the SAFE-OPERATIONAL state
OnThe device is in the OPERATIONAL state
Flickering (on 50ms, off 50ms)The device is booting and has not yet entered
the INITIALIZATION state, or the device is in the
BOOTSTRAP state and firmware download is in
progress. (Optional. Off when not implemented.)
The EVB-LAN9252-DIG-IO utilizes 0x50 (7-bit) I2C slave addressing. The SW3 switch
can be used to select the A0, A1, and A2 address bits, as shown in Figure 2-2 and
Table 2-11. The eighth bit of the slave address determines if the master device wants
to read or write to the EEPROM (24C512).
FIGURE 2-2:SLAVE ADDRESS ALLOCATION
TABLE 2-11:EEPROM SWITCH
SwitchDescriptionSettings
SW3I2C EEPROM address selection switch
(A0, A1, A2). See Figure 2-2.
ON for logic 0 (default)
OFF for logic 1
2.4.4DIG INPUT Mode
The DIG INPUT Mode can be selected through the headers J10 and J11:
• Logic 1 : (Default) SW4 & SW5 Off position. DIG I/P 0 to 15 tied to pull-up (R98 to
R113)
• Logic 0 : The respective knob of 2-way, 8-position dip switch (SW4 & SW5) need
to be moved to ON side. Signals can be selected individually.
Note:The control signal OE_EXT should be connected high by shorting J12 pins
DS50002332A-page 18Preliminary 2014 Microchip Technology Inc.
15 and 16.
Board Details & Configuration
2.4.6DIG Bidirectional Mode
The DIG Bidirectional Mode can be selected by shorting the respective test point pins
with the headers J10 and J11, as detailed in Table 2-14. The input and output signal
states in this mode are the same as detailed in Section 2.4.4 “DIG INPUT Mode” and
All control signals can be probed and controlled via the J12 header, as shown in
Table 2-15.
TABLE 2-15:J12 HEADER CONTROL SIGNAL MAPPING
J12 Pin NumberJ12 SignalJ12 Pin NumberJ12 Signal
13V323V3
3WD_STATE4GND
5EOF6GND
7SOF8GND
9LATCH010 GND
11LATCH112GND
13WD_TRIG14GND
15OE_EXIT163V3
17OUTVALID18GND
19LATCH_IN20GND
Note:J12 pins 15 & 16 must be shorted in output mode.
2.4.7.1WD_STATE
This pin is the SyncManager Watchdog State output. A “0” indicates the watchdog has
expired. The state of this signal can be seen in the LED D22.
Note:This signal is not driven (high impedance) until the EEPROM is loaded.
2.4.7.2LATCH_IN
This pin is the external data latch signal. The input data is sampled each time a rising
edge of LATCH_IN is recognized. By default, this signals is pulled high through
R131and can be made low using switch SW6.
DS50002332A-page 20Preliminary 2014 Microchip Technology Inc.
Chapter 3. LAN9252 EEPROM Programming
3.1PROGRAMMING THE LAN9252 EEPROM
The LAN9252 configures itself to the desired mode (SPI, 6 HBI modes) by reading the
strap settings located in EEPROM. The LAN9252 EEPROM is programmed and validated via the TwinCAT master tool. The programming procedure is as follows:
Note 1:This example utilizes the TwinCAT tool. Procedures may differ when using
other EtherCAT® master tools.
2:Ensure the system network properties are configured properly for the Eth-
erCAT® frames, Ethernet cable linking your system, and EtherCAT® slave
board.
1. Load the corresponding ESI file in the directory path “C:\TwinCAT\Io\EtherCAT”.
For this demo, the ESI file for the 16-Bit Multiplexed Single-Phase Mode is used.
2. If TwinCAT installed successfully, a TwinCAT icon will be shown in the bottom-right corner of the desktop. After clicking the icon, a pop-up list will display.
Select “System Manager”, as shown in Figure 3-1.
3. If any devices are present, delete them accordingly by clicking the device and
selecting “Delete Device”, as shown in Figure 3-2.
FIGURE 3-2:TWINCAT DELETE DEVICE
4. Scan for EtherCAT® slave devices by clicking “I/O devices” and selecting “Scan
Devices”, as shown in Figure 3-3.
FIGURE 3-3:TWINCAT SCAN DEVICES
DS50002332A-page 22Preliminary 2014 Microchip Technology Inc.
LAN9252 EEPROM Programming
5. After scanning is complete, the right panel of the TwinCAT window will appear as
shown in Figure 3-4.
FIGURE 3-4:TWINCAT DEVICE LIST
6. After a successful scan, click the “Device 2 (EtherCAT)” drop down bar on the left
panel of the TwinCAT tool (as highlighted in Figure 3-4). Then click the “Online”
tab on the right-side panel of the TwinCAT tool, as shown in Figure 3-5. Right
click the LAN9252 listing and select “EEPROM Update” from the contextual
menu.
FIGURE 3-5:TWINCAT EEPROM UPDATE
7. Upon selecting “EEPROM Update”, the Write EEPROM window will open. Click
Place the TPs in 100 mil distan ce from the respective IN_DIGIOx or OUT_D IGIOx PINS of J10 & J11
Placement should be such a way that, jumpers should be able to
added between the t est points and J10 or J11 connectors