EtherBerry V1.6

EtherBerry V 1.6 Ethercat® adapter for Raspberry Pi .

EtherCAT® is an Ethernet-based fieldbus system, invented by Beckhoff Automation. The protocol is standardized in IEC 61158 and is suitable for both hard and soft real-time requirements in automation technology. EtherBerry V 1.6 is an extension board for RaspBerry Pi based on LAN9252 EtherCAT® Slave produced by Microchip. The LAN9252 is a 2/3-port EtherCAT® slave controller wi th integrated dual Ethernet PHYs Which Contain each to full-duplex 100BASE-TX transceiver and support 100Mbps (100 BASE-TX) operation. Three possible configurations are possible: Microcontroller Mode, Digital I / O and Expansion Mode.
Our board implements a fusion between the Microcontroller mode and the Digital I/O.


The SPI bus permits the communication with Raspberry PI, while the GPIO are directly connected to LAN9252. These pins are controlled by EtherCAT bus, no from Raspberry GPIO.
The following pins are exposed through pin header JP2:

  • GPIO05
  • GPIO06
  • GPIO12
  • GPIO13
  • GPIO16
  • GPIO19
  • GPIO20
  • GPIO21
  • GPIO22
  • GPIO23
  • GPIO24
  • GPIO26


Every EtherCAT® slave requires a Vendor ID, we use the ID of SG Electronic Systems. This company supports us with boards distribution and their customization.

Etherberry V1.6 Schematic

The EtherBerry is being tested and will be available soon on our shop at a price of €65.

If you want additional informations use our contact form.

EtherBerry V 1.6 Bottom View


EtherBerry V 1.6 Top View





  1. Download the Etherberry Code: EtherBerry_Code_v1.6
  1. Copy Etherberry_Code_v1.6 to Raspberry
  1. Read Instructions.txt in Etherberry_Code_v1.6 directory use the example code.
  1. With the example code provided, it is possible to configure the IO in JP2 as Inputs or Outputs, and read the Inputs  and set the Outputs via Ethercat.
  1. It is possible to Read the i2c RTC (DS3231) via ETHERCAT®
  1. For further applications it is possible add device i2c in Etherberry header JP1

and control via ETHERCAT®: Etherberry XML Configuration ETHERCAT® (ESI)



Dowloand Etherberry XML for configuration slave on ETHERCAT® master: Etherberry_XML_v1.6

Download and install CODESYS Development System V3 from:

Download and install WinPcap from:

Download Codesys project

Unzip and open Etherberry_Demo_Master_v1.6.project

At first opening you see that our Etherberry Ethercat slave is not installed (see the red arrow)

Install Etherberry Ethercat slave clicking on Tools→Device Repository…

Click on Install.. (see red arrow) and select EtherBerry.xml located in Codesys project directory.

Etherberry Salve is installed click Close

Double click on Device (see red Arrow) to open Device Tab.

Click on Codesys Control Win sys (bottom right corner windows see red arrow)

Start PLC

Click ok

In Codesys Project click in selection box (see red arrow) and Press Enter

If everithing is ok PLC will be connected.

Double Click on EtherCAT_Master  (see red arrow)

Click on Browse  (see red arrow)

Select the MAC Address of your PC Ethernet Card  (see red arrow) and click OK.

Double Click  EtherBerry_32_32 (see red arrow) and click EtherCAT I/O Mapping, here are defined the variables associated to the I/O of etherberry slave. ( Don’t do anything to use demo project).

Double Click PLC_PRG(see red arrow) , this is the the code of the demo project. ( Don’t do anything to use demo project).

Set static IP in your PC Ethernet.

Connect network cable between your PC and Etherberry Board (LINK_IN)

Run the EtherBerry from Raspberry (for more detail to compile the code see section Installation Etherberry to Raspberry)

In Codesys Project click  login  (see red arrow).

Click  Start  (see red arrow)

Master and Salve are connected and exchange the data

In the EtherBerry Board you can read the outputs G23,G24,G12,G16,G20,G21 HEADER JP2 or set the inputs G22,G05,G06,G13,G19,G26 HEADER JP2 ETHERBERRY and see the variables changing in the codesys project.


Certification Disclaimer

Leave a Reply

Your email address will not be published. Required fields are marked *