Menu
Cart

EFM32ZGUSB - Getting to Blink in color

This tutorial will help you get set up and start using the EFM32ZGUSB processor board.

First you need to set up the Arduino IDE. To do this follow the instructions in http://store.engimusing.com/pages/arduino-ide-adding-engimusing-boards and come back here when you are done.

If you have just set up the Arduino IDE your board should be connected to the USB cable coming from your computer. If not connect it now. The computer should recognize the board and install the correct drivers.

The LED should blink green every second for 5 seconds and then start blinking a lot faster (6-7 times per second). This is because the board first comes up in the boot loader and after 5 seconds control passes to the application.

Go to Tools->Port and select the port the module is on. On Windows computers this will be a comport like COM1. On Linux and MAC it will look like /dev/ttyUSB0. The number at the end may be different for your system. If you have trouble with this step google "Arduino FTDI" and you will find numerous tutorials on setting up the FTDI drivers.

So if all that is done you should have a screen that looks like:
IDE fresh set up

If you have used the Arduino IDE for another project it may come up with the sketch you were using for that project. If so, go to File->New to start a new sketch and close the window for the other project.

If you don't see "Engimusing EFM32ZGUSB on" in the lower right corner of the IDE you need to select the correct board by Tools->Board->"Engimusing EFMZGUSB".

Next go to File->Examples->01.Basics->Blink and a new window should open containing the blink example.

In the upper left corner under the Edit menu is an arrow pointing to the right (the Upload button, also found in Sketch->Upload).

Click it.

You should see this in the window:
IDE-after-upload

You should see the green LED on the board blinking now at once per second. Big deal! It was probably blinking before you uploaded so we should try something that shows we have really changed it.

Go to Edit->Find... or Ctrl+F and put LED_BUILTIN in the Find: box and 14 in the Replace with: box and then click "Replace All" and then close the Find box.

You should see that every place there was a LED_BUILTIN in the sketch there is now a 14.

Click the arrow and compile and upload the modified sketch.

A short delay after the upload completes successfully you should see the blue LED blinking instead of the green one.

Just for fun now find and replace 14 with 15 everywhere in the sketch and upload it.

This time you should see the red LED blinking.

Well this gets you started. If you want you can create other variations like having the LEDs blink in sequence with different times. Or anything you want.