This example shows how to configure the LAN865x to be used in a 10BASE-T1S Multi-Drop Ethernet network in either PLCA and CSMA/CD mode. It also shows how to r/w registers of the LAN865x during normal operation. Additionally, common Ethernet network functionalities are supported, e.g. ping and iperf.
The parent folder for all the MPLAB X IDE projects for this application is given below:
Application Path : examples\lwIP-dsPIC33CK_Curiosity
To build the application, refer to the table below and open the appropriate project file in MPLABX IDE.
| Project Name | Description |
|---|---|
| dsPIC33_tc6.X | Main project holding the board support package and running the bare metal application. This project pulls in liblwip.X and libtc6.X as libraries. |
| liblwip.X | lwIP TCP/IP stack library |
| libtc6.X | Container to build a library out of the libtc6 source code from the root folder |
- Hardware used
- Hardware setup
- Connect the DEBUG USB port on the board to the computer using a micro USB cable
- Connect the SPI to 10BASE-T1S interface card to another 10BASE-T1S node (e.g. a second instance of this setup)
Configuration is done via #defines in the "main.c".
MAC-PHY Settings The LAN865x MAC-PHY at the beginning of the "main.c":
#define T1S_PLCA_ENABLE (true)
#define T1S_PLCA_NODE_ID (0)
#define T1S_PLCA_NODE_COUNT (8)
#define T1S_PLCA_BURST_COUNT (0)
#define T1S_PLCA_BURST_TIMER (0x80)
#define MAC_PROMISCUOUS_MODE (false)
#define MAC_TX_CUT_THROUGH (true)
#define MAC_RX_CUT_THROUGH (false)
PLCA Settings
10BASE-T1S can be used in PLCA or CSMA/CD mode. When using PLCA, the parameters for Local Node ID, Node Count, Max Burst Count and Burst Timer must be configured. These settings are stored in a subsection inside the MAC-PHY settings.
- Open a Terminal application (e.g. Tera term) on the computer
- Connect to the Virtual COM port and configure the serial settings as follows:
- Baud : 115200
- Data : 8 Bits
- Parity : None
- Stop : 1 Bit
- Flow Control : None
- Build and Program the application using the MPLAB X IDE For optimum results, select "Release" Mode as build target, this requires fee-based XC32 compiler license.

