Note the following details of the code protection feature on Microchip devices:
YSTEM
CERTIFIEDBYDNV
== ISO/TS16949==
•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 unless otherwise stated.
Trademarks
The Microchip name and logo, the Microchip logo, AnyRate, dsPIC, FlashFlex, flexPWR, Heldo, JukeBlox, KeeLoq, KeeLoq logo, Kleer,
LANCheck, LINK MD, MediaLB, MOST, MOST logo, MPLAB, OptoLyzer, PIC, PICSTART, PIC32 logo, RightTouch, SpyNIC, SST, SST
Logo, SuperFlash and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
ClockWorks, The Embedded Control Solutions Company, ETHERSYNCH, Hyper Speed Control, HyperLight Load, IntelliMOS, mTouch,
Precision Edge, and QUIET-WIRE are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Any Capacitor, AnyIn, AnyOut, BodyCom, chipKIT, chipKIT logo, CodeGuard, dsPICDEM, dsPICDEM.net,
Dynamic Average Matching, DAM, ECAN, EtherGREEN, In-Circuit Serial Programming, ICSP, Inter-Chip Connectivity, JitterBlocker,
KleerNet, KleerNet logo, MiWi, motorBench, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, MultiTRAK, NetDetach,
Omniscient Code Generation, PICDEM, PICDEM.net, PICkit, PICtail, PureSilicon, RightTouch logo, REAL ICE, Ripple Blocker, Serial
Quad I/O, SQI, SuperSwitcher, SuperSwitcher II, 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.
DS50002333C-page 2 2015-2016 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 .....................................................................................54
DS50002333C-page 6 2015-2016 Microchip Technology Inc.
EVB-LAN9252-HBI+
ETHERCAT® EVALUATION BOARD
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-HBI+. 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-HBI+ 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-HBI+.
• Chapter 2. “Board Details & Configuration” – Includes details and instructions
for using the EVB-LAN9252-HBI+.
• Chapter 3. “Software Development Kit” – Includes details and instructions for
using the LAN9252 EtherCAT® slave stack firmware and SDK framework.
• Appendix A. “Evaluation Board Photo” – This appendix shows the
EVB-LAN9252-HBI+.
• Appendix B. “Evaluation Board Schematics” – This appendix shows the
EVB-LAN9252-HBI+ schematics.
• Appendix C. “Bill of Materials (BOM)” – This appendix includes the
Choice of mutually exclusive
arguments; an OR selection
Represents code supplied by
user
“Save project before build”
4‘b0010, 2‘hF1
any valid filename
[options]
errorlevel {0|1}
var_name...]
void main (void)
{ ...
}
DS50002333C-page 8 2015-2016 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
production 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:
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
DOCUMENT REVISION HISTORY
RevisionSection/Figure/EntryCorrection
DS50002333C (06-17-16)
All
Figure 1-1
Chapter 2. “Board
Details & Configuration”
2.1.1 “+5V Power”
2.6 “Additional Features”
Chapter 3. “Software
Development Kit”
Appendix A. “Evaluation
Board Photo”
Appendix B. “Evaluation
Board Schematics”
Appendix C. “Bill of
Materials (BOM)”
DS50002333B (05-12-15)
All
Section 1.2 “References”
Section 2.4.4 “DIGIO/HBI/
SPI+GPIO Selection”
Table 2-13, Table 2-14,
and Table 2-15
DS50002333A (02-27-15)Initial Release of Document
Updated board name to “EVB-LAN9252-HBI+”
throughout document.
Updated figure to include UART, Temp. Sensor,
DAC, and ADC.
Updated Figures 1, 5, 6, 7, and 10. Added new Figure 2.
Updated Tables 13, 14, 15, 21.
Removed power supply manufacturer and part number.
Added new section with new features.
Updated figures throughout chapter.
Updated appendix with new photos.
Updated appendix with new schematics.
Updated appendix with updated BOM.
Updated board name to “EVB-LAN9252-HBI”
throughout document, corrected misc. typos and
grammatical errors.
Updated list of application notes.
Added additional information on DIGIO mode.
Simplified table and added note under each table for
clarity.
DS50002333C-page 10 2015-2016 Microchip Technology Inc.
1.1INTRODUCTION
The LAN9252 is a 2-port EtherCAT® Slave Controller (ESC) 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-HBI+ setup, which supports a HBI/SPI+GPIO 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-HBI+ is
shown in Figure 1-1.
DS50002333C-page 12 2015-2016 Microchip Technology Inc.
1.2REFERENCES
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-HBI+ Schematics
• The following application notes:
- AN1916 Integrating Microchip’s LAN9252 SDK with Beckhoff’s EtherCAT®
SSC
- AN1920 Microchip LAN9252 EEPROM Configuration and Programming
- AN1907 Microchip LAN9252 Migration from Beckhoff ET1100
This chapter includes sub-sections on the following EVB-LAN9252-HBI+ details:
•Power
• Resets
• Clock
• Configuration
• Additional Features
• Limitations
• 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. 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 o/p. 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) when the LAN9252 is in reset condition.
For stability, a delay of approximately 180ms is added from the +3.3V o/p 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-HBI+ 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-HBI+ 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-HBI+ is shown in Figure 2-1. Figure 2-2 details
new features.
FIGURE 2-1:EVB-LAN9252-HBI+ TOP VIEW WITH CALLOUTS
FIGURE 2-2:EVB-LAN9252-HBI+ TOP VIEW NEW FEATURE CALLOUTS
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,J6,J7,J9 Chip mode configuration strap
inputs. This strap determines
the number of active ports and
port types.
1-2
Short 1-2 for high (pull-up)
(Not supported in this EVB)
2-3
Short 2-3 for low (pull-down) (default)
Note:This EVB supports Chip mode 00 which is 2-port mode, where Port 0 = PHY
A and Port 1 = PHY B. This requires J4, J6, J7, and J9 to be pulled-down
(2-3) shorted. All other configurations are not supported with this EVB.
2.4.1.2EEPROM SIZE CONFIGURATION
The EEPROM size configuration strap (J5 & J8) 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.
TABLE 2-3:EEPROM SIZE CONFIGURATION STRAP
HeaderDescriptionPinsSettings
J5, J8EEPROM 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 presence of the receive signal is indicated by the external
transceiver as either an open-drain, CMOS level, Loss of Signal (SFP) or a LVPECL
Signal Detect (SFF).
DS50002333C-page 16 2015-2016 Microchip Technology Inc.
Board Details & Configuration
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
2.4.1.3.1Copper Mode
The EVB-LAN9252-HBI+ is set to Copper Mode by default. Table 2-4 details the
required strap resistor settings for Copper Mode operation.
TABLE 2-4:COPPER MODE STRAP RESISTORS
ResistorsDescription
R79 (10K)Configures Port 0 & 1 to Copper Mode
R76, R80 (10K)Configures Port 0 and Port 1 to Copper Mode, respectively
Note:R75, R77, and R78 must not be populated (DNP).
Additionally, the signal routing resistors detailed in Table 2-5 must be assembled for
Copper Mode operation.
TABLE 2-5:COPPER MODE SIGNAL ROUTING RESISTORS
ResistorsDescription
R17, R19, R21, R23Port 0 Copper Mode enabled
R31, R33, R35, R37Port 1 Copper mode enabled
Note:R16, R18, R20, R22, R30, R32, R34, and R36 (0402 package) must not be
populated (DNP).
2.4.1.3.2Fiber Mode
The EVB-LAN9252-HBI+ support SFP type 100BASE-FX. To enable Fiber Mode, the
respective strap and signal routing resistors must be configured.
Note:Copper Mode related resistors must be DNP while Fiber Mode is active
(See Section 2.4.1.3.1 “Copper Mode”).
Table 2-6 details the required strap resistor settings for Fiber Mode operation.
TABLE 2-6:FIBER MODE STRAP RESISTORS
ResistorsDescription
R77 (10K)Configures Port 0 & 1 to FX-LOS Mode
R75, R78 (10K)Configures Port 0 and Port 1 to Fiber Mode, respectively
Note:R76, R79, and R80 must not be populated (DNP).
Additionally, the signal routing resistors detailed in Table 2-7 must be assembled for
Fiber Mode operation.
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-LOS for Port 0 and 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 show 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.)
DS50002333C-page 18 2015-2016 Microchip Technology Inc.
Board Details & Configuration
R/WAA1A00A2011
StartRead/Write
Slave Address
2.4.3EEPROM Switch
The EVB-LAN9252-HBI+ 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-3 and
Table 2-11. The eighth bit of the slave address determines if the master device wants
to read or write to the EEPROM (24FC512).
FIGURE 2-3:SLAVE ADDRESS ALLOCATION
TABLE 2-11:EEPROM SWITCH
SwitchDescriptionSettings
SW3I2C EEPROM address selection switch
(A0, A1, A2). See Figure 2-3.
ON for logic 0 (default)
OFF for logic 1
2.4.4DIGIO/HBI/SPI+GPIO Selection
The EVB-LAN9252-HBI+ supports three LAN9252 configurations:
• DIGIO Mode
•HBI Mode
• SPI + 16 GPIO Mode
DIGIO and HBI modes use the same switch configuration. The DIGIO/HBI or
SPI+GPIO configuration is selected using the DPDT SW11 to SW21 switches. By
default, the EVB is set to DIGIO mode and no code is programmed to the on-board
PIC32MX. In DIGIO mode, headers P1 and P2 can be used to probe the input and output control signals. It is not possible to configure the input or see to output on the LED
on the EVB. Refer to Table 2-22 for a mapping of the DIGIO signals on the P1 and P2
headers.
Note:The PDI configuration which is selected in hardware must match with the
PDI configuration that is chosen in the EtherCAT SDK during the SSC integration process. An appropriate PDI configuration must be set in the ESC
configuration area of the EEPROM.
The LAN9252 supports six HBI modes. These six HBI modes (Multiplexed Modes and
Indexed Modes) can be selected using the SPST switches (P/N: 450301014042-Wurth
Electronics) SW5 through SW9 and SW22 through SW25. Through the switches the
LAN9252 HBI signals are connected to the SoC.
Note:For switch P/N: 450301014042, pin 1 is at the middle of the switch. To short
1-2, knob position must be in the 1-3 position, and vice versa.
2.4.4.1.1Multiplexed Modes
The following four HBI Multiplexed Modes are supported:
1. 8-bit Multiplexed single-phase mode
2. 16-bit Multiplexed single-phase mode
3. 8-bit Multiplexed dual-phase mode
4. 16-bit Multiplexed dual-phase mode
Each HBI Multiplexed Mode requires an updated ESI file, EEPROM and PDI driver with
configured SSC to be programmed to the PIC32MX. For additional software information, refer to Chapter 3. “Software Development Kit”.
Figure 2-5 details the switch selection for Multiplexed Mode. All four Multiplexed Modes
utilize the same switch positions.
FIGURE 2-5:MULTIPLEXED HBI MODE SELECTION
Table 2-13 details the switch selection for Multiplexed Mode.
TABLE 2-13:MULTIPLEXED HBI MODE SELECTION
SwitchSwitch Knob PositionStartDestination
SW5DownA0_AD15A0_CONFIG3
SW6UpRD_RDWRGPMC_DIR
SW7DownALELO_A1A1_CONFIG3
SW8DownWR_ENBGPMC_DE0N_CLE
SW9DownALEHI_A2A2_CONFIG3
SW24UpA0_CONFIG3GPMC_A0_ALE
SW25UpA1_CONFIG3GPMC_A1_ALEHI
DS50002333C-page 20 2015-2016 Microchip Technology Inc.
Board Details & Configuration
Note:When the switch knob is in the down position, pins 1-2 are shorted and the
dot on the switch can be seen. When the switch knob is in the up position,
pins 1-3 are shorted and no dot can be seen.
2.4.4.1.2Indexed Mode
There are 2 different Indexed modes, 8-bit and 16-bit. Each HBI Indexed Mode requires
an updated ESI file, EEPROM and PDI driver with configured SSC to be programmed
to the PIC32MX. For additional software information, refer to Chapter 3. “Software
Development Kit”.
8-Bit Indexed Mode
Figure 2-6 details the switch selection for 8-Bit Indexed Mode.
FIGURE 2-6:8-BIT INDEXED HBI MODE SELECTION
Table 2-14 details the switch selection for 8-bit Indexed HBI Mode.
TABLE 2-14:8-BIT INDEXED HBI MODE SELECTION
SwitchSwitch Knob PositionStartDestination
SW5UpA0_AD15AD15_CONFIG3
SW6UpRD_RDWRGPMC_DIR
SW7UpALELO_A1ALELO_CONFIG3
SW8DownWR_ENBGPMC_DE0N_CLE
SW9UpALEHI_A2ALEHI_CONFIG3
SW24DownALELO_CONFIG3GPMC_A0_ALE
SW25DownALEHI_CONFIG3GPMC_A1_ALEHI
Note:When the switch knob is in the down position, pins 1-2 are shorted and the
dot on the switch can be seen. When the switch knob is in the up position,
pins 1-3 are shorted and no dot can be seen.
16-Bit Indexed Mode
Figure 2-7 details the switch selection for 16-Bit Indexed Mode.
Table 2-15 details the switch selection for 16-bit Indexed HBI Mode.
TABLE 2-15:16-BIT INDEXED HBI MODE SELECTION
SwitchSwitch Knob PositionStartDestination
SW5DownA0_AD15A0_CONFIG3
SW6UpRD_RDWRGPMC_DIR
SW7UpALELO_A1ALELO_CONFIG3
SW8DownWR_ENBGPMC_DE0N_CLE
SW9UpALEHI_A2ALEHI_CONFIG3
SW24X (Don’t Care)XX
SW25DownALEHI_CONFIG3GPMC_A1_ALEHI
Note:When the switch knob is in the down position, pins 1-2 are shorted and the
dot on the switch can be seen. When the switch knob is in the up position,
pins 1-3 are shorted and no dot can be seen.
Note:If any other SoC is used, the user must check what modes are supported
and configure the HBI mode selection switches accordingly.
2.4.4.2SPI+GPIO SELECTION
The knob position of SW11 to SW21 must be down to select the SPI+GPIO mode.
SW19, SW20, and SW21 are used to route the SPI/SQI signals from the LAN9252 to
the SoC. SW11 to SW18 are used to route the 16 GPIO signals from the LAN9252 to
the GPIO circuit.
TABLE 2-16:SW19-SW21 SIGNAL DEFINITIONS
SwitchSignals
SW19 (pin 2-3 & pin 5-6)SIO3 & SIO2
SW20 (pin 2-3 & pin 5-6)SIO0 & SIO1
SW21 (pin 2-3 & pin 5-6)SCK & SCS#
2.4.4.2.1SPI/SQI/I
2
C Aardvark Header
J11 and J12 are used as Aardvark/SPI/SQI headers. The respective pin details are
shown in Table 2-17.
TABLE 2-17:J11 & J12 HEADER PINOUT
SignalPin Number
SCLJ11.1
SDAJ11.3
SCKJ11.7
SCS#J11.9
SI(SIO0)J11.8
SO(SIO1)J11.5
SIO2J12.3
SIO3J12.4
DS50002333C-page 22 2015-2016 Microchip Technology Inc.
Board Details & Configuration
2.4.4.3GPIO INPUT/OUTPUT SELECTION
To enable the SPI+GPIO configuration, the SW11 to SW18 switches must be in the
down position. Additionally, the following switches must be configured to select the
input or output modes, as shown in Table 2-18.
TABLE 2-18:GPIO MODE SWITCH CONFIGURATIONS
SwitchesSwitch Knob PositionMode
SW28 to SW33
SW35 to SW39
SW41 to SW45
SW28 to SW33
SW35 to SW39
SW41 to SW45
2.4.4.3.1GPIO INPUT Mode
In INPUT Mode, Digital I/O values can be selected through dip switches SW34 and
SW40:
• Logic 1 : (Default) SW34 & SW40 Off position. GPI0 to GPI15 tied to pull-up (R90
to R105)
• Logic 0 : The respective knob of 2-way, 8-position dip switch (SW34 & SW40)
need to be moved to ON side. Signals can be selected individually.
Short Pins 1 and 2INPUT Mode
Short Pins 1 and 3OUTPUT Mode
2.4.4.3.2GPIO OUTPUT Mode
In OUTPUT Mode, updated GPO values will be seen on the green LEDs (D7 to D22):
• Logic 1 : LED illuminated (green)
• Logic 0 : LED not illuminated.
Note:The LED (D7 to D22) anode is connected to ASIC.
2.4.5SoC
The EVB-LAN9252-HBI+ supports both an on-board SoC and add-on SoC. By default,
the on-board SoC is enabled. However, an external add-on SoC can be connected via
the add-on SoC headers P1 and P2. The SoC selection is configured via the SW26
switch, as detailed in the following subsections.
2.4.5.1SOC SELECTION
The SW26 switch selects the enabled SoC. The SW26 switch knob position must be
down (Text = “PIC”) to select the on-board PIC. If the switch knob position is up (Text =
“PIM”), then the add-on board/SoC is selected and the on-board PIC is always in the
reset state. Whenever an add-on board/SoC is used, the switch knob must be in the up
position.
By default, the on-board Microchip PIC32MX795F512L (U7) is used as the default
SoC. The LAN9252 can be connected to the PIC using either an HBI or SPI interface.
The selection switches must be configured accordingly to enable the desired interface.
Refer to Section 2.4.4 “DIGIO/HBI/SPI+GPIO Selection” and Section 2.4.4.1 “HBI
Mode Selection” for additional details.
2.4.5.2.1Reset
SW27 is used to reset the on-board PIC. The LAN9252 can also reset the SoC if the
reset pin is configured to output mode. For stability, a delay of approximately 180ms is
added from the 3.3V o/p to reset release.
2.4.5.2.2ICSP Header
The on-board PIC programing is performed using the ICSP header J13. Table 2-20
details the ICSP header pinout
TABLE 2-20:J13 ICSP HEADER PINOUT
J13 PinSettings
1MLCR
23V3
3GND
4PGD2
5PGC2
6NC
2.4.5.2.3SoC EEPROM
The EVB-LAN9252-HBI+ provides an optional SoC EEPROM. Some SoCs may
require an EEPROM. However, the PIC on-board SoC and PIC based add-on SoC
boards do not require this EEPROM.
2.4.5.3ADD-ON SOC
An add-on board can be attached to the EVB-LAN9252-HBI+ to use an add-on SoC.
The add-on board must be mounted to the P1 and P2 connectors (2x23, 100mil normal
gold plated berg stick). The SW26 switch must be in the up position when using an
add-on SoC. Additionally, the J10 2-pin jumper must be shorted to route power to the
add-on board from the EVB-LAN9252-HBI+.
2.4.5.4ESC ID SELECT
The signals shown in Table 2-21 are provided as EtherCAT® ID selection for complex
ESCs. Jumper J20 and respective pull-up resistors are used to configure the ID select
signals high or low. By default, there are no resistors populated and all signals are neither high or low. When required, populating the respective jumper or resistor will
change the ID select signal to low.
TABLE 2-21:ID SELECT SIGNALS
ID Selection
Signal
ID0ID0_SELECT_RB025R12332:31
ID1ID_SELECT_RB124R12430:29
ID2ID_SELECT_RB223R12528:27
ID3ID_SELECT_RB322R12626:25
ID4ID_SELECT_RB421R12724:23
Signal Name
PIC Pin
Number
10k to Pull
High
Pins to Short
for Pull Low
DS50002333C-page 24 2015-2016 Microchip Technology Inc.
Board Details & Configuration
TABLE 2-21:ID SELECT SIGNALS (CONTINUED)
ID Selection
Signal
ID5ID_SELECT_RB520R12822:21
ID6ID_SELECT_RB832R12920:19
ID7ID_SELECT_RB933R13018:17
ID8ID_SELECT_RB1034R13116:15
ID9ID_SELECT_RB1135R13214:13
ID10ID_SELECT_RB1241R13312:11
ID11ID_SELECT_RB1342R13410:9
ID12ID_SELECT_RC16R1358:7
ID13ID_SELECT_RC27R1366:5
ID14ID_SELECT_RC38R1374:3
ID15ID_SELECT_RC49R1382:1
Signal Name
2.5DIGIO & SPI+16GPIO SIGNALS ON P1 AND P2 HEADERS
2.5.1DIGIO on P1 and P2 Headers (up to 16 bits supported)
PIC Pin
Number
10k to Pull
High
Pins to Short
for Pull Low
The LAN9252 supports a DIGIO mode, where these signals can be probed on the P1
and P2 headers. To enable DIGIO mode, from the default state of the board, the SW26
switch must be changed to the PIM position (upward). The respective DIGIO signal
mappings on the P1 and P2 headers are detailed in Table 2-22.
Note 1:In the default state, headers P1 and P2 are not assembled. These headers
can each be populated with a Molex 87758-4616.
2:The user must ensure that the EEPROM is configured in DIGIO mode.
2.5.2SPI+GPIO on P1 and P2 Headers (up to 16 bits supported)
The LAN9252 supports an SPI+16GPIO mode, where these signals can be probed on
the P1 and P2 headers. To enable SPI+16GPIO mode, from the default state of the
board, the SW26 switch must be changed to the PIM position (upward) and SW19,
SW20, and SW21 must be changed to the downward side. The respective
SPI+16GPIO signal mappings on the P1 and P2 headers are detailed in Table 2-23.
Note 1:In the default state, headers P1 and P2 are not assembled. These headers
can each be populated with a Molex 87758-4616.
2:The user must ensure that the EEPROM is configured in DIGIO mode.
TABLE 2-23:SPI+16GPIO MODE P1 & P2 HEADER SIGNALS
HBI IndexedHBI MultiplexedSPI+16GPIOP1/P2 Pin
RD/RD_WRRD/RD_WRGPI15/GPO15P1.8
WR/ENBWR/ENBGPI14/GPO14P1.10
CSCSGPI13/GPO13P1.26
A4-GPI12/GPO12P1.41
A3-GPI11/GPO11P1.44
A2ALEHIGPI10/GPO10P2.21
A0/D15AD15GPI9/GPO9P1.15
D14AD14GPI8/GPO8P1.16
D13AD13GPI7/GPO7P1.11
D12AD12GPI6/GPO6P1.12
D11AD11GPI5/GPO5P1.17
D10AD10GPI4/GPO4P1.14
D9AD9SCKP1.13
D8AD8GPI2/GPO2P1.19
D7AD7GPI1/GPO1P1.4
D6AD6GPI0/GPO0P1.3
D5AD5SCS#P1.22
D4AD4GPI3/GPO3P1.23
D3AD3SIO3P1.6
D2AD2SIO2P1.5
D1AD1SO/SIO1P1.24
D0AD0SI/SIO0P1.25
DS50002333C-page 26 2015-2016 Microchip Technology Inc.
2.6ADDITIONAL FEATURES
The EVB-LAN9252-HBI+ includes additional features that were not available in the previous revision of the board. This section details these additional features. To learn more
about how to use them refer to the Quick Start guide found at microchip.com.
2.6.1Potentiometer
The EVB-LAN9252-HBI+ includes a potentiometer, as shown in Figure 2-8. The potentiometer is used as an input to the PIC32 and is labeled as “pot1” on the board.
FIGURE 2-8:POTENTIOMETER POT1
Board Details & Configuration
2.6.2Temperature Sensor
The EVB-LAN9252-HBI+ includes a Microchip temperature sensor (TC104AVNBTR),
as shown in Figure 2-9. The temperature sensor is used as an input into the PIC32 and
is labeled “U9” on the board.
FIGURE 2-9:TEMPERATURE SENSOR U9
2.6.3UART RS-232
A RS-232 connector is present on the board as J24. This allows serial communication
with the PIC32. With this connector UART communication is possible as both an input
and an output.
2.6.4DAC
Through an on-board Microchip digital to analog converter (MCP4726) it is possible to
use the EtherCAT application to input a value to the DAC and get a calculated voltage
output on the DAC. It it labeled as U10 on the board and can be seen next to the potentiometer.
2.7LIMITATIONS
The EVB-LAN9252-HBI+ has the following limitations:
1. While the LAN9252 supports both SFP and SFF Fiber Modes, the
EVB-LAN9252-HBI+ supports only the SFP Fiber Mode.
2. SQI is not supported when using the on-board PIC32MX.
DS50002333C-page 28 2015-2016 Microchip Technology Inc.
Chapter 3. Software Development Kit
This chapter explains the architecture of the LAN9252 EtherCAT® slave stack firmware
sample and introduces the SDK framework for use with PIC32MX microcontroller for
EVB-LAN9252-HBI+ development.
The LAN9252 ESC supports interfacing to an external SoC using an SPI or HBI interface. This PIC32 based SDK sample contains separate projects for HBI and SPI interfaces.
This software SDK is developed as a bare-metal firmware implementation (not specific
to any OS) designed to access the LAN9252 ESC features via an HBI or SPI interface.
The EtherCAT® slave stack portion of the source is obtained from EtherCAT Technology Group.
This software project has been tested with the EVB-LAN9252-HBI+ using the
PIC32MX SoC.
Figure 3-1 provides an architectural block diagram of the SDK’s various source modules. The subsequent sections detail these blocks.
This code block is part of the user application that boots the PIC microcontroller with
the desired RAM configuration, clock speed, clock source and other related features of
the controller, per the user’s configuration.
3.2.1.2PERIPHERAL INITIALIZATION
This code block configures and initiates the core peripherals (UART, I
external peripherals (EEPROM, LAN9252).
3.2.1.3MAIN APPLICATION
This code block contains the code that runs the LAN9252 EtherCAT® slave module
demo application.
2
C, SPI) and
3.2.2EtherCAT® Slave Stack
This code block contains the EtherCAT slave stack.
3.2.3Hardware Abstraction Layer (HAL)
This code block contains the low level layer that provides software hooks/APIs to the
application module and slave stack, allowing communication between these modules
and the hardware resources. For additional information, refer to the ReadMe.txt file
located in the project source folder.
DS50002333C-page 30 2015-2016 Microchip Technology Inc.
3.3USING THE SAMPLE PROJECT
3.3.1MPLAB IDE Project Settings & Firmware Download
The PIC32 project folder contains the sample code that enables the LAN9252's HBI
interface to communicate with the SoC. HBI demo code is provided for each of the
LAN9252’s six HBI configurations. These configurations can be selected respectively
from the configuration drop down box as shown in Figure 3-4.
HBI_MSP_8BIT_XC32_PIC32MX79F5128-bit Multiplexed single phase mode
HBI_MSP_16BIT_XC32_PIC32MX79F51216-bit Multiplexed single phase mode
FIGURE 3-4:MPLAB IDE HBI CONFIGURATION SELECTION
3.3.1.2PIC32 PROJECT FOLDER
The PIC32-SPI project folder contains the demo code that enables the LAN9252's SPI
interface to communicate with the SoC.
• Refer to the LAN9252 data sheet for more details on these HBI interface and its
modes.
• Refer to Section 2.4.4 “DIGIO/HBI/SPI+GPIO Selection” for SPI jumper configurations.
DS50002333C-page 32 2015-2016 Microchip Technology Inc.
Software Development Kit
3.3.2Compiling and Programming SoC Firmware
1. Compile the source code (with corresponding configuration selected if HBI project is loaded).
FIGURE 3-5:MPLAB IDE COMPILE PROJECT SELECTION
2. If the compilation is successful, the output window will display “BUILD SUCCESSFUL”, as shown in Figure 3-6.
FIGURE 3-6:MPLAB IDE BUILD SUCCESSFUL
3. Before initiating the firmware download, ensure the debugger/programmer is
connected to the EVB’s JTAG pins. (This demo project is debugged with the
PICkit-3 In-Circuit debugger/programmer).
4. To program the PIC32 SoC, click the “Make and Program Device Main Project”
button.
5. To debug the PIC32 SoC, click “Debug Main Project” button.
FIGURE 3-8:MPLAB IDE DEBUG DEVICE
3.4PROGRAMMING 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 EEPROM can also be programmed using an
external IIC Master, like AARDVARK.
3.4.1Programming LAN9252 EEPROM using the TwinCAT Master
Tool
The programming procedure using the TwinCAT master tool 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\3.1\Con-
fig\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 bot-
tom-right corner of the desktop. After clicking the icon, a pop-up list will display.
Select “TwinCAT XAE (VS 2013)”, as shown in Figure 3-9.
FIGURE 3-9:TWINCAT SYSTEM MANAGER
DS50002333C-page 34 2015-2016 Microchip Technology Inc.
Software Development Kit
3. Click on “New TwinCAT Project” as shown in Figure 3-10. Choose a name and
click “ok”.
FIGURE 3-10:TWINCAT DELETE DEVICE
4. Scan for EtherCAT® slave devices by expanding “I/O” and right clicking
“Devices” and then selecting “Scan”, as shown in Figure 3-11.
FIGURE 3-11:TWINCAT SCAN DEVICES
5. After scanning is complete, a window showing devices found will appear similar
to Figure 3-12.
6. Click “Yes” for Scan for Boxes and “Yes” for Activate Free Run.
7. 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-11). Then click the “Online”
tab on the right-side panel of the TwinCAT tool, as shown in Figure 3-13. Right
click the LAN9252 listing and select “EEPROM Update” from the contextual
menu.
FIGURE 3-13:TWINCAT EEPROM UPDATE
8. Upon selecting “EEPROM Update”, the Write EEPROM window will open. Click
the “OK” button to initiate EEPROM programming (Figure 3-14).
FIGURE 3-14:TWINCAT WRITE EEPROM
DS50002333C-page 36 2015-2016 Microchip Technology Inc.
ETHERCAT® EVALUATION BOARD
Appendix A. Evaluation Board Photo
A.1INTRODUCTION
This appendix shows the EVB-LAN9252-HBI+ Evaluation Board.