I am honored to get the XMC4800 EtherCAT kit returned by a netizen for evaluation. Most of the MCUs I used before were from TI and ST. My impression of Infineon was that Infineon was very good at making IGBTs. Later, when I came into contact with EtherCAT technology, I had a further understanding of Infineon's XMC4300 and XMC4800 EtherCAT slave solutions. The official website also released related EtherCAT kits, which are quite expensive. I am honored to participate in the evaluation this time. 1. First acquaintance with the hardware When I got this board for the first time, here are some beautiful photos to see the layout of the board. At first glance, the motherboard is a bit like TI's launchpad series of boards, and the corresponding layout is similar. There are 2 buttons and 2 LEDs for program interaction verification. There are also SD card interfaces, Ethernet interfaces, CAN interfaces, USB interfaces, etc. There is also an Arduino-compatible interface near the inner side of the pin header. In addition, the motherboard has a jlink emulator onboard, and the chip is XMC4200. Users do not need to use jlink or other emulators.
The sub-board is the interface board of EtherCAT, including two Ethernet ports (IN & OUT) and related interface devices, and also contains 8 LED lights to indicate IO ports.
Like TI launchpad, it adopts plug-in installation. 2. Learn about the hardware resources of XMC4800 XMC4800 is a high-end product of Infineon XMC4000 series MCU, based on ARM cortex-M4F core. The specific parameters are as follows (from the official website). The 4800 series focuses on EtherCAT slave applications, and has very rich peripheral resources.
- 1024 - 2048 KB Flash, 200-352 KB Ram
- Supply voltage range: 3.13 - 3.63V
- USIC 6ch [Quad SPI, SCI/UART, I2C, I2S, LIN]
- 2x PWM Timers (CCU8), 16-64Bit 8ch+ Dead-Time
- 6x CAN, 256 MO
- Peripherals Clock: 144 [MHZ]
- Core frequency: 144 [MHZ]
- 4x ΔΣ-Demodulator
- External Memory Interface (EBU)
- Package: LQFP144/LQFP100/LFBBGA196
- Temperature range: -40°.....85°/125°
- 10/100 Ethernet MAC ( /w IEEE 1588)
- SDIO/SD/MMC Interface
- Watch Dog Timer, Real Time Clock
- XMC4000 Functional Safety Package
- EtherCAT node
3. Development environment DAVE construction and simple LED control program writing process 1) xmc4800 supports many IDEs, such as ARM/MDK, IAR and Infineon's own DAVE software. This software is based on Eclipse and uses the GCC series for compilation. The software can be downloaded from the official website for free. After a simple installation, the development environment can be built. 2) Here, the APP function of the DAVE software is used to implement a button control LED program. This is the first time to contact DAVE and the first time to use APP. I feel that the function is very powerful. Users do not need to consider the underlying code design at all and can concentrate on their own application code. The specific steps are as follows: A. Open the DAVE software, select Create a new DAVE project, then select DAVE CE project, and name the project. Click next
B. Select the specific chip corresponding to XMC4800, leave other options as default, and then click finish.
C. After completion, enter the main interface. The interface is divided into 4 areas, namely project view (upper left), code area (upper right), APP component view (lower left), APP dependency view (lower right)
D. According to the requirements of the example, we only use 2 GPIO APP modules this time. Add 2 modules as shown in the figure, name them LED and BUTTON respectively, and set the relevant interfaces, such as port direction, pull-up and pull-down configuration, initial value, etc.
E. Specify the actual pins of the relevant PINs respectively. You can set them by right-clicking the mouse in pin mapping. The pins that have been set will turn blue.
F. After all configurations are completed, click Generate code in the main menu DAVE to generate relevant code. G. For GPIO, the generated code is in the Generated file in DAVE, which mainly includes 4 application functions:
- DIGITAL_IO_SetOutputHigh()
- DIGITAL_IO_SetOutputLow()
- DIGITAL_IO_ToggleOutput()
- DIGITAL_IO_GetInput()
H. Here we need two functions: read input and invert output. Add the following content in Main.c:
- while(1U) { if(DIGITAL_IO_GetInput(&BUTTON0)==0) { delay(5000); if(DIGITAL_IO_GetInput(&BUTTON0)==0){ DIGITAL_IO_ToggleOutput(&LED0); } } }
复制代码I. Click Compile and run the program, and the effect is as follows. Before pressing the button:
After pressing the button:
This content is originally created by flyword, a netizen of EEWORLD forum. If you want to reprint or use it for commercial purposes, you must obtain the author's consent and indicate the source