ASIX AX58400-TSB User manual

1
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Revision 1.10
October. 17th, 2023
AX58400 GPIO / AIO
User Guide

2
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Revision History
Revision
Date
Description
1.00
2021/12/08
Initial release
1.10
2023/10/17
1.Added Evaluation Board License Agreement.

3
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
CONTENT
1. Introduction ....................................................................................................................6
2. Requirements..................................................................................................................6
3. Board Description...........................................................................................................9
3-1 AX58400-TSB........................................................................................9
3-2 AX58400-EXB-ADIO............................................................................10
4. Basic Operation of TwinCAT .......................................................................................11
4-1 Open XAE through Visual Studio 2010 / 2013......................................11
4-2 Project creation & download EEPROM ................................................11
5. Download Firmware to AX58400 .................................................................................19
5-1 STM32CubeProgrammer Tool Method.................................................20
5-2 ARM KEIL MDK Method.......................................................................23
5-3 STM32Cube Method............................................................................25
5-4 Check Firmware Status........................................................................30
6. PLC Application............................................................................................................33
6-1 Import PLC...........................................................................................33
6-2 PD Link ................................................................................................40
6-3 Link Reference.....................................................................................44
6-4 Execution PLC .....................................................................................44
7. ADC / DAC Description ................................................................................................48
8. Switch ID Description...................................................................................................49
9. Firmware Upgrade through EtherCAT FoE ................................................................58
10. Shortest EtherCAT Cycle Evaluation........................................................................63

4
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
List of figure
Figure 2 - 1 ..........................................................................................................................................................6
Figure 2 - 2 ..........................................................................................................................................................7
Figure 2 - 3 ..........................................................................................................................................................7
Figure 2 - 4 ..........................................................................................................................................................7
Figure 2 - 5 ..........................................................................................................................................................8
Figure 3 - 1 ..........................................................................................................................................................9
Figure 3 - 2 ........................................................................................................................................................10
Figure 4 - 1 ........................................................................................................................................................11
Figure 4 - 2 ........................................................................................................................................................11
Figure 4 - 3 ........................................................................................................................................................12
Figure 4 - 4 ........................................................................................................................................................12
Figure 4 - 5 ........................................................................................................................................................13
Figure 4 - 6 ........................................................................................................................................................13
Figure 4 - 7 ........................................................................................................................................................13
Figure 4 - 8 ........................................................................................................................................................14
Figure 4 - 9 ........................................................................................................................................................14
Figure 4 - 10 ......................................................................................................................................................15
Figure 4 - 11 ......................................................................................................................................................15
Figure 4 - 12 ......................................................................................................................................................15
Figure 4 - 13 ......................................................................................................................................................16
Figure 4 - 14 ......................................................................................................................................................16
Figure 4 - 15 ......................................................................................................................................................17
Figure 4 - 16 ......................................................................................................................................................17
Figure 4 - 17 ......................................................................................................................................................17
Figure 4 - 18 ......................................................................................................................................................18
Figure 4 - 19 ......................................................................................................................................................18
Figure 4 - 20 ......................................................................................................................................................18
Figure 4 - 21 ......................................................................................................................................................18
Figure 5 - 1 ........................................................................................................................................................19
Figure 5 - 2 ........................................................................................................................................................20
Figure 5 - 3 ........................................................................................................................................................20
Figure 5 - 4 ........................................................................................................................................................21
Figure 5 - 5 ........................................................................................................................................................21
Figure 5 - 6 ........................................................................................................................................................22
Figure 5 - 7 ........................................................................................................................................................23
Figure 5 - 8 ........................................................................................................................................................24
Figure 5 - 9 ........................................................................................................................................................24
Figure 5 - 10 ......................................................................................................................................................25
Figure 5 - 11 ......................................................................................................................................................25
Figure 5 - 12 ......................................................................................................................................................27
Figure 5 - 13 ......................................................................................................................................................28
Figure 5 - 14 ......................................................................................................................................................29
Figure 5 - 15 ......................................................................................................................................................29
Figure 5 - 16 ......................................................................................................................................................30
Figure 5 - 17 ......................................................................................................................................................31
Figure 5 - 18 ......................................................................................................................................................31
Figure 5 - 19 ......................................................................................................................................................32
Figure 6 - 1 ........................................................................................................................................................33
Figure 6 - 2 ........................................................................................................................................................33
Figure 6 - 3 ........................................................................................................................................................34
Figure 6 - 4 ........................................................................................................................................................34

5
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Figure 6 - 5 ........................................................................................................................................................35
Figure 6 - 6 ........................................................................................................................................................35
Figure 6 - 7 ........................................................................................................................................................36
Figure 6 - 8 ........................................................................................................................................................37
Figure 6 - 9 ........................................................................................................................................................37
Figure 6 - 10 ......................................................................................................................................................38
Figure 6 - 11 ......................................................................................................................................................39
Figure 6 - 12 ......................................................................................................................................................39
Figure 6 - 13 ......................................................................................................................................................40
Figure 6 - 14 ......................................................................................................................................................41
Figure 6 - 15 ......................................................................................................................................................42
Figure 6 - 16 ......................................................................................................................................................43
Figure 6 - 17 ......................................................................................................................................................43
Figure 6 - 18 ......................................................................................................................................................44
Figure 6 - 19 ......................................................................................................................................................45
Figure 6 - 20 ......................................................................................................................................................45
Figure 6 - 21 ......................................................................................................................................................45
Figure 6 - 22 ......................................................................................................................................................45
Figure 6 - 23 ......................................................................................................................................................46
Figure 6 - 24 ......................................................................................................................................................47
Figure 7 - 1 ........................................................................................................................................................48
Figure 8 - 1 ........................................................................................................................................................49
Figure 8 - 2 ........................................................................................................................................................49
Figure 8 - 3 ........................................................................................................................................................50
Figure 8 - 4 ........................................................................................................................................................50
Figure 8 - 5 ........................................................................................................................................................51
Figure 8 - 6 ........................................................................................................................................................51
Figure 8 - 7 ........................................................................................................................................................52
Figure 8 - 8 ........................................................................................................................................................52
Figure 8 - 9 ........................................................................................................................................................53
Figure 8 - 10 ......................................................................................................................................................53
Figure 8 - 11 ......................................................................................................................................................54
Figure 8 - 12 ......................................................................................................................................................55
Figure 8 - 13 ......................................................................................................................................................55
Figure 8 - 14 ......................................................................................................................................................56
Figure 8 - 15 ......................................................................................................................................................57
Figure 9- 1 .........................................................................................................................................................58
Figure 9- 2 .........................................................................................................................................................59
Figure 9- 3 .........................................................................................................................................................59
Figure 9- 4 .........................................................................................................................................................60
Figure 10 - 1 ......................................................................................................................................................63
Figure 10 - 2 ......................................................................................................................................................64
Figure 10 - 3 ......................................................................................................................................................64
List of Table
Table 5 - 1..........................................................................................................................................................24
Table 6 - 1..........................................................................................................................................................44

6
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
1. Introduction
This document introduces how to setup entire environment for GPIO / AIO application on AX58400 evaluation
platform (TSB + EXB-ADIO boards). The demo application of EtherCAT master side is developed using PLC
(Programmable Logic Controller) language running on BECKHOFF TwinCAT engineering (XAE). The IDE
relies on Microsoft Visual Studio 2010 / 2013. We can execute the application through the IDE or pure
BECKHOFF runtime package (XAR). The firmware part of EtherCAT slave side is developed using C
language through ARM KEIL MDK (Microcontroller Development Kit).
The firmware mainly handles the tasks below:
⚫BECKHOFF SSC (Slave Stack Code)
⚫Hardware access of SSC through SPI interface at MCU side
⚫Simple object form for CIA-401 digital/analog IO
⚫Peripherals (GPIO / ADC / DAC) accessed by EtherCAT PD (Process Data)
The PLC at EtherCAT master side mainly handles the tasks below:
⚫PD mapping / handling by PLC for GPIO / AIO
⚫A demo GUI
2. Requirements
Before starting to setup the environment, the user should prepare some software and hardware. Of course,
they are all running based on general desktop PC with windows 7/10 operation systems. The software and
hardware requirements are listed as following:
[Software at EtherCAT master side]
⚫Windows 7 / 10 operation system
⚫Microsoft Visual Studio 2010 / 2013
⚫Beckhoff TwinCAT XAE v3.1.4022.28 or later
Figure 2 - 1
Note: You can download the BECKHOFF TwinCAT here or contact ASIX Electronics Corporation.

7
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
[Software at EtherCAT slave side]
⚫ARM KEIL MDK micro-Vision 5 (for development only)
Figure 2 - 2
⚫STM32CubeIDE 1.4.0 or later
Figure 2 - 3
[Hardware]
⚫AX58400 Test Board (AX58400-TSB) x 1
Figure 2 - 4

8
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
⚫AX58400 ADIO Expansion Board (AX58400-EXB-ADIO) x 1
Figure 2 - 5

9
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
3. Board Description
3-1 AX58400-TSB
AX58400-TSB is an evaluation board for AX58400 IC and has the components list below:
⚫AX58400 –An ASIX IC that integrated an ESC (EtherCAT Slave Controller) with a dual-core ARM
cortex-M7/M4
⚫ESC Port0 –Port0 of the ESC
⚫ESC Port1 –Port1 of the ESC
⚫USB2.0 OTG –USB2.0 OTG port of AX58400
⚫Power –Power input port of AX58400-TSB
⚫Reset –Reset button of AX58400
⚫Boot Mode Enable –Force AX58400 entering Boot Mode
⚫3 Port Mode –Enable ESC port 2, default is Disable
⚫User Button –Button can be used for user
⚫ICE –ICE connector for STLink-V3Mini
Figure 3 - 1

10
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
3-2 AX58400-EXB-ADIO
AX58400-EXB-ADIO is an expansion board for AX58400 GPIO / AIO application and has the components list
below:
⚫LEDs for Digital Output –Digital output (8-bit) to the LEDs
⚫DIP Switch for Digital Input –Dip switch to the digital input (8-bit)
⚫Analog Input Pin –You can measure the input voltage of ADC by this PIN
⚫Analog Output Pin –You can measure the output voltage of DAC by this PIN
⚫Variable Resistor –You can adjust input voltage of ADC through this component
⚫ESC Port2 –Port2 of the ESC
⚫Rotary Dip Switch –A rotary dip switch that can assign a 16-bit digits
⚫RS232 Port –The I/O of this RS232 port comes from UART of AX58400-TSB
Figure 3 - 2

11
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
4. Basic Operation of TwinCAT
Before starting up the AX58400-TSB, you MUST burn the correct content into AX58400 EEPROM first.
If there is no the correct content in EEPROM, the MCU will be reset forcibly by ESC.
Assume that you already installed the BECKHOFF TwinCAT XAE in your environment.
Please follows the sections to burn the correct content into EEPROM by download.
4-1 Open XAE through Visual Studio 2010 / 2013
Open the XAE by clicking below system tray icon:
Figure 4 - 1
4-2 Project creation & download EEPROM
Any common deploy or applications through TwinCAT XAE should operate in a TwinCAT project. Create an
empty TwinCAT project and scan the EtherCAT slaves that the master found. If you have a Beckhoff real-time
compatible network adapter (ex: Intel I-350) in the system, TwinCAT master can bundle the adapter as main
EtherCAT port. If you have 2 adapters, the second adapter can be used for redundancy. Whatever, you
should create a TwinCAT project first for any EtherCAT task under TwinCAT XAE. Please refer to below
steps:
⚫Step 1: Click the “New TwinCAT Project…”
Figure 4 - 2

12
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
⚫Step 2: Specify “Name”and “Location”and click “OK”.
Figure 4 - 3
⚫Step 3: Click the “TWINCAT -> Show Realtime Ethernet Compatible Devices…”
Figure 4 - 4
⚫Step 4: Make sure your network adapter installed BECKHOFF EtherCAT real-time driver
If not installed, please click “Install”.

13
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Figure 4 - 5
⚫Step 5: Please locate the ESI (EtherCAT Slave Information) file
“AX58400_GPIO_8Bit_AIO_16bit.xml”in the BSP directory:
“YOUR_BSP_FOLDER\SampleCode\ AX58400_GpioAio\For_TwinCAT\ESI\”
Figure 4 - 6
⚫Step 6: Copy the file to TwinCAT directory: “C:\TwinCAT\3.1\Config\Io\EtherCAT\”
Figure 4 - 7
⚫Step 7: Click “TWINCAT -> EtherCAT Devices -> Reload Device Descriptions”.

14
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Figure 4 - 8
⚫Step 8: Plug USB power and then connect ESC port0 to TwinCAT master port.
Figure 4 - 9
⚫Step 9: Right-click on “IO / Devices”and select “Scan”.

15
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Figure 4 - 10
⚫Step 10: Choose main network adapter.
Figure 4 - 11
⚫Step 11: Click “Yes”.
Figure 4 - 12
⚫Step 12: Click “Yes”.

16
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Figure 4 - 13
⚫Step 13: Double click “Device N (EtherCAT)”and you will see the TwinCAT master found the
EtherCAT slave
Figure 4 - 14
⚫Step 14: Select the slave, then right-click and choose “EEPROM Update…”

17
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Figure 4 - 15
⚫Step 15: Select the “AX58400_GPIO_8Bit_AIO_16Bit”and click “OK”.
Figure 4 - 16
⚫Step 16: Wait for progress bar at lower right corner of the TwinCAT screen.
Figure 4 - 17
⚫Step 17: Select “Device N (EtherCAT)”, right-click and choose “Remove”.

18
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
Figure 4 - 18
⚫Step 18: Click “Yes”.
Figure 4 - 19
⚫Step 19: Execute “Scan”again (repeat Step 7 ~ 11) and you will see below screen.
If AX58400 does not download available firmware with Slave Stack Code yet,
the field of “State”will show “INIT INIT_ERR”.
Figure 4 - 20
If there is a firmware with Slave Stack Code in AX58400, you should see below screen. The
“State”field will show “OP”, that means the device in OP mode.
Figure 4 - 21
Note: Please refer to Chapter 5 for firmware download.

19
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
5. Download Firmware to AX58400
If you want to download firmware to AX58400, you have 3 ways basically:
(1) STM32CubeProgrammer Tool Method
(2) ARM KEIL MDK Method
(3) STM32Cube Method
If you do not need to develop in further, just refer the way (1). Otherwise, you may refer the item (2) or (3).
However, please install the ST-Link Driver first to do the following method. You can download the
driver through the link ST-LINK DRIVER or install the driver from AX58400 BPS\Driver folder directly.
Figure 5 - 1

20
Copyright (C) 2021-2023 Reserved by ASIX Electronics Corporation
AX58400
GPIO / AIO User Guide
Reference Design User Guide
5-1 STM32CubeProgrammer Tool Method
Please install STSW-LINK009 driver which is for ST-LINK/V2, ST-LINK/V2-1 and STLINK-V3 boards first. You
can download the tool through the link STM32CubeProgrammer tool, or install it from AX58400 BSP\Tool
folder directly. Run the STM32CubeProgrammer tool and you will see the picture as below.
Figure 5 - 2
And let “STLink-V3Mini Port”to connect your host as following:
Figure 5 - 3
This manual suits for next models
1
Table of contents
Other ASIX Motherboard manuals