If you're looking for a quick and easy DIY project that requires a programmable logic or microcontroller, the first thing that may come to mind is an Arduino. These boards are well-known for their affordability, ease of use, and abundance of online guides and tutorials. However, sometimes your project may require more advanced features such as increased memory, faster CPU performance, or additional GPIO pins. In these cases, it's worth considering Infineon's XMC-for-Arduino series of boards.
These boards are based on Infineon's XMC microcontroller family and offer a range of advanced features and peripherals, making them suitable for a wide variety of applications. Plus, they can be programmed using the Arduino IDE, so you can take advantage of the vast Arduino community and online resources. So, if you're looking to elevate your DIY projects with the added capabilities of a high-performance microcontroller, the Infineon XMC-for-Arduino series is worth checking out.
IntroductionInfineon has a family of microcontrollers called XMC. These XMC microcontrollers are also divided into two main versions, one being XMC1000 (ARM® Cortex®-M0) and the second one XMC4000 (ARM® Cortex®-M4 with a built-in DSP instruction set). Now these microcontrollers have many real-world applications such as:
- Power conversion
- Factory and building automation
- Transportation
- Home appliances
and many more.
But here comes the interesting part for the makers out there:
The XMC microcontrollers have their evaluation boards/kits which can be taken advantage of for DIY projects. To make these boards even more user-friendly, Infineon has put together a GitHub repository and integrated some of these Boards into the Arduino IDE, so you can deal with them as if you're dealing with a regular Arduino, except it's not.
Furthermore, some of these boards also come with the Arduino form factor (see pictures below). Famous Boards are:
- XMC1100 XMC 2Go(no Arduino form factor)
- XMC1100 Boot Kit
- XMC1300 Boot Kit(no Arduino form factor)
- XMC1400 Kit for Arduino
- XMC4200 Platform 2Go
- XMC4400 Platform 2Go
- XMC4700 Relax Kit
As you can see from the pictures above most of them are maker friendly in terms of every board having its own Debugger, GPIO Pins, Power- and User LEDs, some of them have GPIO Push-buttons and a typical MicroUSB 5 V power supply.
How to setup XMC Boards to work with Arduino IDEIn order to use and program the Infineon XMC microcontrollers in the Arduino IDE, SEGGER J-Link must be installed on your PC. Please follow this link to SEGGER J-Link and install the J-Link Software and Documentation Pack for your operating system.
If you have already installed 'DAVE™ - Development Platform for XMC™ Microcontrollers', you can skip this step as the respective drivers/programs are already installed on your system.
If you are downloading J-Link for the first time, make sure to check this box: Install USB Driver for J-Link.
Required Tools
XMC-for-Arduino requires Python 3.x and pyserial
. Make sure Python is installed on your machine and available in the system path.
You can check if it was successfully installed by opening your command line or terminal and typing:
You can check if it was successfully installed by opening your command line or terminal and typing:
python --version
With pip available, install the mentioned packages from a terminal:
pip install pyserial
Integration in Arduino IDEPlease first download the Arduino IDE. This package is only tested for Arduino IDE >=1.5. We recommended to use Arduino IDE >=2.0.
Paste the following URL into the 'Additional boards manager URLs' input field under File > Preferences to add Infineon's XMC microcontroller boards to the Arduino IDE.
https://github.com/Infineon/XMC-for-Arduino/releases/latest/download/package_infineon_index.json
To install the boards, please go now to Tools > Board > Boards Manager... and search for XMC. You will see options to install the board files for the microcontrollers. Click "Install" to add the boards to your Arduino IDE.
In the boards list Tools > Board, you will now find the supported XMC microcontroller boards.
Notes
- The differences of the boards included in this repository if compared to the Arduino boards
- Refer also to the LICENSE.md/txt file of the repositories for further information
- The Boot Kits have limitations if compared to the official Arduino boards (consult the XMC-for-Arduino Wiki for more information)
- XMC-for-Arduino support for 'arm-linux-gnueabihf' only until version 1.1.
Certain obsolete boards (see wiki) and non-functional libraries were removed from the board support package for the release version 2.0.0, alongwith some other major changes (see release notes). After version 3.0.0, the release index will not include library before version 2.0.0.
The boards until version 1.7.0 have been clubbed under XMC Family V1.x.
Any new board or feature integration from now on will only be done in the XMC Family V2.x
Viewing boards supported in XMC Family v1.x Board Package
IMPORTANTNOTES:
· This integration will only work for Arduino IDE >=1.5
· The XMC1100 Boot Kit has limitations if compared to the official Arduino boards (consult the XMC-for-Arduino Wiki for more information)
· Refer also to the LICENSE.md/txt file on the GitHub Repository for further information
Why XMC-for-Arduino instead of an Arduino Board?We knew you had this question in mind. Well, the hardware and design of the evaluation Board are the main difference of course. For example, take a look at the picture of the XMC2Go above: it's the size of a match stick, so it won't take much space in your small applications. Ok, that's not so impressive in the 21st century, but the thing is, there is a very big variety of Infineon's Shields2Go compatible with it, which you can simply mount on the XMC2Go (plug-and-play principle) and make an application out of it.
Another thing, if you take a look at the XMC4700 Relax Kit you'll notice that it has many GPIO Pins (80-excluding the original Arduino form factor pins), 23 of these pins are PWM pins, so if we're talking in terms of servos, for example, that's 23 independently driven servo motors.
The typical operating voltage of an Arduino Board is 5 V. Its XMC alternatives, (XMC1100 BootKit and XMC1400 for Arduino) can be configured to operate with 3.3 V by simply re-soldering the 0-Ohm resistor next to the 3.3 V and 5 V pin. So if you have a 3.3 V Shield, there is no need to get a level-shifter.
This one is for the spec freaks out there: the ATMega2560 (Arduino Mega µ-controller) and the ATmega328P (Arduino UNO R3 µ-controller) run at 16 MHz. The XMC1100 (XMC2Go & XMC1100 Boot Kit µ-controller) runs at 32 MHz, that's double the trouble. XMC4700 even goes up to 144 MHz!
The XMC4700 Relax Kit also comes with a CAN transceiver.
HINT: If you're using a Shield2Go you can simply plug in the MyIoT Adapter).
Also, the main difference in terms of software is, that there are more functions built-in with the XMC Board Package, for example, you can change the PWM frequency of a PWM pin on the XMC with a simple built-in function:
setAnalogWriteFrequency( uint8_t pin, uint32_t frequency );
there is no built-in function for a regular Arduino that does that, you're probably going to have to make a custom function of your own.
Convinced? Let's give you a quick start!
“Run, XMC. Run!”Enough talking, let's get to running a program on one of the XMC for Arduino Boards using the Arduino IDE. (Pre-requisite: Follow the Instructions in sections 2 and 3 of this post).
The following is a typical guide when dealing with any type of XMC microcontroller board that's compatible with Arduino (See the list in section 1).
First, open up the Arduino IDE and select the board you're using (For this example I'm using the XMC1100 BootKit):
NOTE: If you're using one of Infineon's Kits2Go, select XMC1100 XMC2Go as your Board.
Then connect your board via a MicroUSB cable to your PC and select the corresponding port in the Arduino IDE:
HINT: If you don’t know which port your XMC device is connected to (because it's probably not going to be COM12 like in the picture below) just check all ports before plugging in the micro-USB cable and then check after, to see which port was added. It's a hassle if you have many ports but that's an easy way to find out.
That's basically it, after you're done with writing a program or opening an example from File =>Examples you just hit the upload button.
This script or example does nothing but toggle LED 1 of the 6 User LEDs of the XMC1100 BootKit and then it just prints out "1" if it's on or "0" if it's off on the serial monitor.
IMPORTANT: Two things to take home from this example:
- "digitalToggle()" is also one of the built-in functions in the XMC microcontroller Board package (XMC-for-Arduino); It does not work when using a regular Arduino Board.
- Did you notice the macro that's defined on top of the setup() function? The pins on an XMC-for-Arduino Board usually correspond to an Arduino pin, which can be known by visiting the Board's wiki from the GitHub repository:
Not only can you view the pinout diagram of the board, but there is also some useful information. Make sure to always check the wiki regularly for updates.
Here's another example, where an XMC4700 Relax Kit is being used to drive 5 Servo Motors at once, You can also find the code in the attachment section:
RECOMMENDATION: It is recommended to use an external power supply when controlling 5+ Servos with an XMC because one servo can draw up to 200 mA.
You can also find the corresponding Arduino pins of the XMC4700 Relax Kit's X1 and X2 GPIO pins (additional to the Arduino Uno form factor) in the pins_arduino.h file of the GitHub repository. (Location: XMC-for-Arduino/variants/XMC4700/config/XMC4700_Relax_Kit).
E.g. the code below translates to: "P2.15 on the XMC4700 corresponds to Pin 0 in the Arduino IDE".
/* 0 */ {XMC_GPIO_PORT2, 15}, // RX P2.15
FarewellSo, this is it, folks! XMC for Arduino in a nutshell. Also visit our Hackster page, where you'll find some interesting use cases for the XMC, e.g a Smart Window Opener or how to easily extract data (plug-and-play principle) from a Shield2Go Sensor on an XMC2Go or just a Kit2Go.
It's recommended to regularly check our GitHub repository for updates and also if you have a problem with any of the Boards or Libraries you can easily open an issue there.
Last but not least, the Shields2Go mentioned earlier also have their own Arduino Libraries which can be found either in the Library Manager in the Arduino IDE or their repositories can be found on GitHub for you to clone. You can add them manually through Sketch => IncludeLibrary => Add.ZIPLibrary... in the Arduino IDE.
Stay Safe. XMC-you later!
Comments