Artemis Development with the Arduino IDE

Pages
Contributors: santaimpersonator, Liquid Soulder, Member #1571936
Favorited Favorite 3

Introduction

The SparkFun Artemis is an amazing module. So much functionality packed into a tiny 10x15mm footprint! But what really makes it powerful is the ability to quickly write sketches and build projects using only Arduino code. However, for more industry oriented programmer, it is also compatible with Arm® Mbed™ OS. Whether you are using one of our boards that has the Artemis module pre-integrated or have your own, this tutorial will get you started with the Arduino IDE and familiarize you with the various interfaces of the Artemis module.

SparkFun Artemis Module - Low Power Machine Learning BLE Cortex-M4F

SparkFun Artemis Module - Low Power Machine Learning BLE Cortex-M4F

WRL-15484
$9.95

Product showcase of the new Artemis module.

Required Materials

To follow along with this tutorial, you'll need development board with an Artemis module and a USB-C cable.

SparkFun RedBoard Artemis ATP

SparkFun RedBoard Artemis ATP

DEV-15442
$26.95
2
SparkFun RedBoard Artemis

SparkFun RedBoard Artemis

DEV-15444
$21.50
10
SparkFun Thing Plus - Artemis

SparkFun Thing Plus - Artemis

WRL-15574
$22.50
3
SparkFun OpenLog Data Collector with Machinechat - Environmental Monitoring

SparkFun OpenLog Data Collector with Machinechat - Environmental Monitoring

KIT-20683
$264.95
USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$5.50
4

USB 2.0 Cable A to C - 3 Foot

CAB-15092
Retired

USB 2.0 C to C Cable - 1m

CAB-16395
Retired

Programming Firmware

Users interested in flashing their module will need an ARM Programmer and need to solder on a JTAG header. We recommend these programmers from our catalog:

Header - 2x5 Pin (Male, 1.27mm)

Header - 2x5 Pin (Male, 1.27mm)

PRT-15362
$1.75

J-Link EDU Mini Programmer

PGM-15345
1 Retired

J-Link EDU Base Programmer

PGM-15346
2 Retired

J-Link BASE Compact Programmer

PGM-15347
Retired

Examples

Some of the Arduino examples in this tutorial will require additional hardware.

SparkFun Qwiic Cable Kit

SparkFun Qwiic Cable Kit

KIT-15081
$8.95
22
Trimpot 10K Ohm with Knob

Trimpot 10K Ohm with Knob

COM-09806
$1.05
6
SparkFun Environmental Sensor Breakout - BME680 (Qwiic)

SparkFun Environmental Sensor Breakout - BME680 (Qwiic)

SEN-16466
$18.95
3
Hook-Up Wire - Assortment (Stranded, 22 AWG)

Hook-Up Wire - Assortment (Stranded, 22 AWG)

PRT-11375
$22.50
19
Jumper Wires Premium 6" M/F Pack of 10

Jumper Wires Premium 6" M/F Pack of 10

PRT-09140
$4.50
1

SparkFun Beginner Tool Kit

TOL-14681
Retired

Zio Qwiic OLED Display (0.91 in, 128x32)

LCD-16774
2 Retired

Suggested Reading

If you aren’t familiar with the following concepts, we recommend checking out these tutorials before continuing.

Installing an Arduino Library

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

What is an Arduino?

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Installing Board Definitions in the Arduino IDE

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Serial Peripheral Interface (SPI)

SPI is commonly used to connect microcontrollers to peripherals such as sensors, shift registers, and SD cards.

Pulse Width Modulation

An introduction to the concept of Pulse Width Modulation.

Logic Levels

Learn the difference between 3.3V and 5V devices and logic levels.

I2C

An introduction to I2C, one of the main embedded communications protocols in use today.

Analog vs. Digital

This tutorial covers the concept of analog and digital signals, as they relate to electronics.

Bluetooth Basics

An overview of the Bluetooth wireless technology.

Processor Interrupts with Arduino

What is an interrupt? In a nutshell, there is a method by which a processor can execute its normal program while continuously monitoring for some kind of event, or interrupt. There are two types of interrupts: hardware and software interrupts. For the purposes of this tutorial, we will focus on hardware interrupts.

How to Solder: Through-Hole Soldering

This tutorial covers everything you need to know about through-hole soldering.

How to Install CH340 Drivers

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

Designing with the SparkFun Artemis

Let's chat about layout and design considerations when using the Artemis module.

Artemis Development with Arduino

Get our powerful Artemis based boards (Artemis Nano, BlackBoard Artemis, and BlackBoard Artemis ATP) blinking in less than 5 minutes using the SparkFun Artemis Arduino Core!

Do I Need Drivers?

Driver Compatibility: Make sure that the driver for the CH340 is up to date; the serial-to-UART chip may require the latest driver to operate properly. For instructions for updating your driver, please refer to the tutorial below.

Some of our development boards utilize a WCH CH340C or CH340G UART-to-serial chip. A driver should not be required for Mac OSX, Linux, Windows 10; however, we do have a driver installation tutorial available for users.

How to Install CH340 Drivers

August 6, 2019

How to install CH340 drivers (if you need them) on Windows, Mac OS X, and Linux.

The rest of our development boards utilize an NXP interface chip with DAPLink. A driver is not required for Mac OSX, Linux, Windows 10; however, there is a serial port driver available for Windows 7 (only), which is provided by Mbed™. Further instructions and details on installing the serial port driver can be found in the Mbed™ OS documentation.

(*As the Mbed™ OS documentation is continually updated, so are the links. Therefore, users may find it useful to look under the Tutorials > Serial Communication section of the (updated) Mbed™ OS documentation for the serial port driver information.)

Setting up the Arduino IDE

Installing the Arduino IDE

Note: For first-time users, who have never programmed before and are looking to use the Arduino IDE, we recommend beginning with the SparkFun Inventor's Kit (SIK), which includes a simpler board like the Arduino Uno or SparkFun RedBoard and is designed to help users get started programming with the Arduino IDE.

Most users will be familiar with the Arduino IDE and it's use. As a point of reference for professional developers who aren't aware, the Arduino IDE is an open-source development environment, written in Java, that makes it easy to write code and upload it to a supported board. For more details, feel free to check out the Arduino website.

To get started with the Arduino IDE, check out the following tutorials:

Installing an Arduino Library

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

What is an Arduino?

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Installing Board Definitions in the Arduino IDE

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Installing the Apollo3 Board Definitions

Note: The Arduino core for the Apollo3 (i.e. the board definitions) is only compatible up to release 1.8.12. We are currently looking into the issue.

Users will need to install the SparkFun Apollo3 Boards board definitions in the Arduino IDE for our development boards with an Artemis module. Please use the guide below, to get started with installing the SparkFun Apollo3 core for the Artemis modules:

Installing Board Definitions in the Arduino IDE

September 9, 2020

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Otherwise, users can check out this tutorial on Installing Additional Cores provided by Arduino. Users will also need the .json file for the SparkFun Apollo3 Arduino Core:

Once, the .json file has been added to the Additional Boards Manager URLs, search for Apollo3 in the Boards Manager.

board manager
SparkFun Apollo3 Boards listed in the Boards Manager. (Click to enlarge)

To complete the installation process, selected the SparkFun Apollo3 Boards core and click on the INSTALL button that appears in the lower, right-hand corner. The board definition along with the associated libraries and example sketches will be installed automatically. (*Make sure that the Apollo3 Arduino core is at least version 2.0.0.)

examples listed
boards listed

SparkFun's Apollo3 boards and examples listed in the Arduino IDE. (Click to enlarge)

Installing the BLE Library

For users interested in the BLE functionality of the Apollo3 and Artemis boards, we have provided full support to the Arduino BLE library. Additional details about the library can be referenced from the documentation provided by Arduino.

Users will need to install the Arduino BLE library to take advantage of that functionality; please use the guide below, to get started with installing the Arduino BLE library:

Installing an Arduino Library

January 11, 2013

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

Programming the Artemis Module

Users should refer to the hookup guide for their board for the programming procedures. However, below is a summary of the available methods:

Drag and Drop Method

Development boards that utilize an NXP interface chip with DAPLink with appear as a mass storage device for drag-and-drop programming. The interface chip will accept a .hex or .bin file that is compiled for that specific board and program the Artemis module accordingly.

drag and drop programming
Drag-and-drop programming for the Artemis Development Kit. (Click to enlarge)

Serial Upload w/ ASB or SVL Bootloader

Known Issue: With the latest v2.0.0 Apollo3 Arduino core, there is an issue uploading sketched using the SVL.

Users can use the ASB to workaround this issue; however, it is recommended that users be aware of that there seems to be some sort of issue when uploading with the Serial Monitor left open. Even though the upload completes successfully the program does not execute.

Development boards that utilize a WCH CH340C or CH340E UART-to-serial chip will be programmed utilizing the serial bootloader.

UART chip
WCH CH340C UART-to-serial chip on the BlackBoard Artemis.

The Artemis modules on these boards come preloaded with two bootloaders. The SparkFun Variable Bootloader (SVL) will allow you reliably and conveniently load new code at data rates up to 921600bps. In addition to the SVL, we also enable the Ambiq factory bootloader for secure boot applications. Almost all users should use the SparkFun Variable Bootloader and forget about the Ambiq factory bootloader. For more information checkout the programming section of the Designing with the Artemis Module tutorial. Don't worry - you cannot damage or brick your Artemis using the incorrect bootloader.

The bootloader menu inside the SparkFun Apollo core
Don't select Ambiq Secure Bootloader unless you know what you're doing

Note: For users who are using the Ambiq Secure Bootloader to upload Arduino sketches.... beware - there seems to be some sort of issue when uploading with the Serial Monitor left open. Even though the upload completes successfully the program does not execute.

The status LED is great for troubleshooting and debugging code. For all of our boards with an Artemis module, the status LED can be accessed in the Mbed-CLI with the variable LED1. However, we have already linked the LED_BUILTIN variable to the Blink example built into the Arduino IDE.

Blink

With full Arduino support, users will be able to implement the built-in examples of the Arduino IDE on the Artemis DK. To begin, let's start with the most basic example: Blink. From the drop down file menu, pull up the script:

select blink example
Screen shot of the built-in Blink example in the Arduino IDE.

Note: Users who need the compiled binary code in order to program the Artemis DK, save this example somewhere that is easily accessible; the desktop is a good option. (*Remember to use Save As, so that you retain the original example within the Arduino IDE.)

save example to desktop
Blink example being saved to the Desktop.

Next, you will want to select the appropriate board from the tools drop down menu: Tools > Board: > Select a Board

select artemis dk board
Selecting an Artemis board definition in the Arduino IDE.

The last step is to program your board. Use the programming method associated with your board.

Operation

This example is very fundamental and should result in the LED blinking on and then off, with a period of a second. Follow the steps for programming the associated board to see the code in action.

LED Blinking
A demonstration of the STAT LED blinking.

Serial Port: Hello World and Enabling Peripherals

In this example, we will create a code that outputs Hello World to the serial monitor, through the USB connection of the associated board. Unfortunately, there isn't an example built into the Arduino IDE, so users will need to copy and past the code below.

language:c
// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // print out "Hello World"
  Serial.println("Hello World");
  delay(500);
}

Follow the steps for programming the associated board to see the code in action.

Operation: Serial Monitor

This example outputs Hello World to the serial monitor, through the USB connection of the associated board. Follow the steps for programming the associated board to see the code in action.

Once the board is programmed, open the serial monitor on the Arduino IDE; make sure to set the baud rate to 9600 baud. Hello World should be printed out continuously.

hello world
Hello World print out in the Arduino IDE Serial Monitor.

Configuring Peripheral Serial Ports/Pins

In order for users to understand how to adapt their code to configure the peripheral UART ports and pins, we have provided a built-in example for the Apollo3 core. From the file drop-down menu: File > Examples > Apollo3 > Serial.

serial example
Built-in Serial example for the Apollo3 core.

ADC: AnalogRead

The ADC pins are useful for measuring analog voltage inputs. To get started, we have provided a built-in example for the Apollo3 core. From the file drop-down menu: File > Examples > Apollo3 > AnalogRead.

ADC example
Built-in AnalogRead example for the Apollo3 core.

Wiring

Users should be familiar with the ADC example in the SIK. Please, remember that some boards are rated at 3.3V; and therefore, the potentiometer should be tied to 3.3V on the high side.

Operation: Serial Monitor

This example outputs ADC values to the serial monitor, through the USB connection of the associated board. Follow the steps for programming the associated board to see the code in action.

Once the board is programmed, open the serial monitor on the Arduino IDE; make sure to set the baud rate to 115200 baud. A 14-bit value should be printed out based on the associated ADC input voltage.

ADC demo
A print out of the voltage measured by the ADC pin, on the Arduino IDE Serial Monitor.

PWM: AnalogWrite

The PWM pins are useful for controlling servos or emulating an analog voltage functionality. To get started, we have provided a built-in example for the Apollo3 core. From the file drop-down menu: File > Examples > Apollo3 > AnalogWrite.

PWM example
Built-in AnalogWrite example for the Apollo3 core. (Click to enlarge)

Operation

This example is very fundamental and should result in the LED dimming/fading on and off. Follow the steps for programming the associated board to see the code in action.

pwm demo
The brightness of the LED should cycle, fading in and out. (Click to enlarge)

I2C: Qwiic OLED Display

The I2C pins are useful connecting to peripheral devices. In this example, let's use the Qwiic OLED Display and the example code from the online tutorial.

SparkFun Qwiic OLED Display (0.91 in., 128x32)

LCD-17153
9 Retired

The hookup guide direct users through the installation of the associated Arduino libraries. Once the library is installed, follow the instructions from the online tutorial to get the example up and running.

Note: In the Apollo3 Arduin core, the Wire library (for the I2C communication) is configured to use the dedicated I2C pins attached to a board's Qwiic connector, by default.

Wiring

Users should be familiar with our Qwiic system. Here is a link to our Qwiic cable kit, if necessary.

Operation

This example display various patterns across the display. Follow the steps for programming the associated board to see the code in action.

oled demo
The Zio OLED display running with the example code from their online tutorial.

Configuring Peripheral I2C Ports/Pins

In order for users to understand how to adapt their code to configure the peripheral I2C ports, we have provided the following example for the Apollo3 core: File > Examples > Apollo3 > I2C.

I2C example
Built-in I2C example for the Apollo3 core. (Click to enlarge)

SPI: BME680 Environmental Sensor

The SPI pins are useful connecting to peripheral devices, with high-speed communication. In this example, let's use the SparkFun Environmental Sensor Breakout - BME680 and the SPIDemo example from the library provided for the product. Additional, materials like hookup wire and soldering equipment will be required.

Users will need to follow the hookup guide to install the associated Arduino libraries. Once the library is installed, select the SPIDemo example from the File > Examples > BME680 > SPIDemo menu. Refer to the board's hookup guide to verify the pins utilized for the SPI library; the example code may need to be adapted.

Wiring

Users will need to follow the hookup guide to connect the sensor properly. Soldering the appropriate SPI connections using some hookup wire.

Operation: Serial Monitor

This example outputs sensor values to the serial monitor, through the USB connection of the associated board. Follow the steps for programming the associated board to see the code in action.

Once the board is programmed, open the serial monitor on the Arduino IDE; make sure to set the baud rate to 9600 baud. The environmental sensor readings should be be displayed on the Serial Monitor.

Configuring Peripheral SPI Ports/Pins

In order for users to understand how to adapt their code to configure the peripheral SPI ports, we have provided the following example for the Apollo3 core: File > Examples > Apollo3 > SPI.

SPI example
Built-in SPI example for the Apollo3 core. (Click to enlarge)

Bluetooth: LED

Install BLE Library

For users interested in the BLE functionality of the Apollo3 and Artemis boards, we have provided full support to the Arduino BLE library. Additional details about the library can be referenced from the documentation provided by Arduino.

Users who haven't already done so, will need to install the Arduino BLE library to continue with this example; please use the guide below, to get started with installing the Arduino BLE library:

Installing an Arduino Library

January 11, 2013

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

Peripheral LED Example

Note: Users will need to download the NRF Connect app onto their phone. We highly recommend utilizing an Android phone as we have had difficulties with device connections in the app for Apple phones.

As in the prior examples, these steps will follow a similar procedure.

  1. From the drop down file menu, open the LED sketch: File > Examples > ArduinoBLE > Peripheral > LED.
  2. Save the sketch (File > Save As...) using the file drop down menu.
  3. Select the then, export the compiled binary code (Sketch > Export compiled Binary) using the sketch drop down menu.
  4. Drag and drop (or copy) the binary .bin file into the ARTEMIS mass storage drive. The storage drive will automatically eject once the programming is complete.
  5. To verify that the board is working and that the programming was successful, open a terminal emulator, such as TeraTerm or the Serial Monitor in the Arduino IDE. Connect to the serial port for the Artemis DK; don't forget to set the baud rate to 9600 bps.
  6. Click the reset button to begin the program. Users should see a BLE LED Peripheral message in the terminal emulator.
  7. Follow the steps and video below to control the STAT LED on the Artemis DK.
    1. Unlock the phone and enable the Bluetooth.
    2. Open the NRF app.
    3. Click on the Scan button on the upper right corner.
    4. In the results, locate the device labeled LED. Click on the CONNECT button to the right of the device name.
      • In the terminal emulator, users should see a Connected to central: message followed by the mac address of the phone.
    5. Once connected, locate the Unknown Service. It will have the following service UUID: 19B10000-E8F2-537E-4F6C-D104768A1214.
    6. Click on the service. Then, locate and click on the upload button (up arrow).
    7. A dialog box will open. We want to write a value, so locate the New Value text field, under the Write value drop-down menu option. Based on the control inputs to the LED, an LED on or LED off message will appear in the terminal emulator.
      • Enter 01 to turn the LED on. Then click the SEND button.
      • Enter 00 to turn the LED off. Then click the SEND button.

Utilizing the example with the NRF phone app.

bluetooth serial output
Serial output of the LED Bluetooth example. (Click to enlarge)

What About Interrupts?

Interrupts allow users to interrupt the code running in the main loop of their code and execute another set of instructions (with an interrupt handler or interrupt service routine) before returning back to the main loop.

Processor Interrupts with Arduino

December 11, 2018

What is an interrupt? In a nutshell, there is a method by which a processor can execute its normal program while continuously monitoring for some kind of event, or interrupt. There are two types of interrupts: hardware and software interrupts. For the purposes of this tutorial, we will focus on hardware interrupts.

Check out these Arduino pages for more information on interrupts:

Real Time Operating System (RTOS)

With the incorporation of Mbed™ OS into the Apollo3 Arduino core, to support the Bluetooth functionality, it now functions as a RTOS. This increases the complexity of the code implementation. In order to help users understand how to adapt their code to utilize interrupts, we have provided the following examples for the Apollo3 core: File > Examples > Apollo3 > Pick Example

threads example
The Threads example.
attach interrupt example
The AttachInterrupt example.
detach intterrupt example
The DetachInterrupt example.
Click an image to enlarge.

For more details on the RTOS and interrupt functionality, check out the Mbed™ documentation on scheduling APIs.

Troubleshooting Tips

Below, we have also included some additional troubleshooting tips for issues that you may come across with the Artemis Development Kit.

  1. One of our employees compiled a great list of troubleshooting tips based on the most common customer issues. This is the perfect place to start.
  2. For any Arduino IDE specific issues, we recommend starting with their troubleshooting guide.

If neither of the troubleshooting guides above were able to help, here are some tips you might have missed. (Most of this material is summarized from the tutorial.):

Are You Using a Recommended Computer OS?

This board is not compatible with the Arduino Web IDE. We do NOT recommend using a Chromebook, Netbook, tablet, phone, or the Arduino Web IDE in general. If you are here, try a RECOMMENDED operating system.

My Board Isn't Working:

Every Artemis board gets tested before getting packaged up. That being said, let's try a basic test to see if just the board is working. Disconnect everything that you have attached to the board; we just want to test the board.

  1. Inspect the board:
    Check the board to make sure everything looks about right. Use the pictures on the product page to verify component placement or alignment, and bad solder joints, or damage.
  2. Power and check the status LEDs:
    Using a known good USB-C cable, plug your board in to the computer. Do any of the status LEDs turn on?
    • New boards, out of the bag, usually come programmed with a test sketch. Often it is a sketch that blinks that status LED at a rate of approximately 2 blinks per second.
  3. Test a Blink sketch:
    Try to program the blink sketch. Why blink? It is simple, known to work (from the example files), and you have an indicator LED.
    • Double check that you have the proper Board selected prior to uploading or exporting the compiled binary.
    • For boards that are already running the blink example, I recommend changing the timing parameters to check for a change in the board's response.
    Verify that you see the status LED blinking properly. If you are having trouble compiling or exporting the binary file for the Artemis DK, try using this pre-compiled binary file.
  4. Driver Installation:
    The CH340 serial-to-UART chip may require the latest driver to operate properly. For the associated boards, make sure that the driver is up to date. For instructions for updating your driver, please refer to the CH340 driver installation tutorial.

I Don't See My Board on a Serial/COM Port:

If you don't see your board as an available COM port on the Arduino IDE:

  • Try to re-open the Arduino IDE.
  • Check the Device Manager to verify that your computer recognizes the board.
  • The issue might be related to your USB cable. Check that you are using a USB cable capable of data transfers. Some cables only have the power pins connected for charging. A good way to test this is to plug in a device to your USB cable (like a phone). If it doesn't show up as a device or drive, then try a new USB-C cable.
  • This rarely happens, but it is easy to check. If you are using a USB 3.0 port (you will see a blue "tongue" in the USB jack or bad USB port, try a different USB port. You can also try to test the board on a different computer to double check for a hardware incompatibility (usually with expansion boards).

Errors Uploading to the Board:

There are two types of issues that you will usually see in the console of the Arduino IDE, compile errors or upload errors. The easiest way to see where to start is by clicking the Verify button (check mark); the Arduino IDE will try to compile your code. A failure here is a compile error.

It takes a some experience, but if you enable the verbose output from the Arduino IDE preferences, it may give you more clues to where the issue is.

Screen shots of enabling verbose output

Screen shots of how to enable verbose output. Click to enlarge.

  • Compile Errors:
    With compile errors, there are several things that could be causing issues. However, 99% of the time, it is user error. Usually something wrong with your code or the library you are using. Once in a while you will have a file structure issue if you manually added a file/folder in any of the Arduino folders (still user error).
  • Upload Errors:
    Upload errors get a little more tricky. You will usually just see the Arduino IDE trying to upload to the board multiple times. There are usually several different causes for this, often without specific errors in the console. Here are a few common examples:
    • Wrong Board Selection:
      Double check you board selection options. If you uploaded with the wrong board selection, there is a small chance that you may have overwritten the bootloader on the board or damaged the microcontroller.
    • Missing Bootloader:
      If your board has the bootloader flashed, pin 13 will flash several times on power up.
    • Serial Port Interference:
      If a device is communicating to the microcontroller over digital pins 0 and 1, while you are trying to upload code.
    • Bad USB cable or port (see Serial Port section above).

Additional Tips:

  • If an input pin is read and that is floating (with nothing connected to it), you may see random data/states. In practice, it is useful to tie an input pin to a known state with a pull-up resistor (to VCC), or a pull-down resistor (to GND).
  • There is a maximum amount of current an I/O pin can source (provide positive current) or sink (provide negative current). You can usually power small sections of LED strips or small motors, but will run into issue with high power devices.
  • The pins on your board may use 3.3V logic and aren't directly compatible with 5V devices.

Resources and Going Further

Need some inspiration for your next project? Check out some of these related tutorials:

SparkFun Tutorials

Installing an Arduino Library

How do I install a custom Arduino library? It's easy! This tutorial will go over how to install an Arduino library using the Arduino Library Manager. For libraries not linked with the Arduino IDE, we will also go over manually installing an Arduino library.

What is an Arduino?

What is this 'Arduino' thing anyway? This tutorials dives into what an Arduino is and along with Arduino projects and widgets.

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Installing Board Definitions in the Arduino IDE

How do I install a custom Arduino board/core? It's easy! This tutorial will go over how to install an Arduino board definition using the Arduino Board Manager. We will also go over manually installing third-party cores, such as the board definitions required for many of the SparkFun development boards.

Arduino Tutorials

Arduino Board Comparison Guides

Choosing an Arduino for Your Project

Examining the diverse world of Arduino boards and understanding the differences between them before choosing one for a project.

Standard Arduino Comparison Guide

Arduino Comparison Guide Uno or Pro Mini? Bluetooth or wireless? When it comes to Arduinos, there are a lot of choices. We've compiled every Arduino development…

RedBoard vs. Uno

In this tutorial we discuss the differences and similarities between the RedBoard and the Arduino Uno (SMD and PTH). The development platforms
Beginner

Click the buttons above for tutorials relating to the board functionality based on topic difficulty.

Beginner

Serial Communication

Asynchronous serial communication concepts: packets, signal levels, baud rates, UARTs and more!

Analog to Digital Conversion

The world is analog. Use analog to digital conversion to help digital devices interpret the world.

Logic Levels

Learn the difference between 3.3V and 5V devices and logic levels.

Analog vs. Digital

This tutorial covers the concept of analog and digital signals, as they relate to electronics.

Data Types in Arduino

Learn about the common data types and what they signify in the Arduino programming environment.

How to Work with Jumper Pads and PCB Traces

Handling PCB jumper pads and traces is an essential skill. Learn how to cut a PCB trace, add a solder jumper between pads to reroute connections, and repair a trace with the green wire method if a trace is damaged.

Artemis Development with Arduino

Get our powerful Artemis based boards (Artemis Nano, BlackBoard Artemis, and BlackBoard Artemis ATP) blinking in less than 5 minutes using the SparkFun Artemis Arduino Core!

Intermediate

Serial Peripheral Interface (SPI)

SPI is commonly used to connect microcontrollers to peripherals such as sensors, shift registers, and SD cards.

I2C

An introduction to I2C, one of the main embedded communications protocols in use today.

Processor Interrupts with Arduino

What is an interrupt? In a nutshell, there is a method by which a processor can execute its normal program while continuously monitoring for some kind of event, or interrupt. There are two types of interrupts: hardware and software interrupts. For the purposes of this tutorial, we will focus on hardware interrupts.

Advanced

Integrated Circuits

An introduction to integrated circuits (ICs). Electronics' ubiquitous black chips. Includes a focus on the variety of IC packages.

Bluetooth Basics

An overview of the Bluetooth wireless technology.

Reading and Writing Serial EEPROMs

EEPROM is a great way to add extra memory to your microcontroller project. Wait 'til you see how easy it is to use!

ARM Programming

How to program SAMD21 or SAMD51 boards (or other ARM processors).

Designing with the SparkFun Artemis

Let's chat about layout and design considerations when using the Artemis module.

Software Development Guides

Using SparkFun Edge Board with Ambiq Apollo3 SDK

We will demonstrate how to get started with your SparkFun Edge Board by setting up the toolchain on your computer, examining an example program, and using the serial uploader tool to flash the chip.

Artemis Development with Arduino

Get our powerful Artemis based boards (Artemis Nano, BlackBoard Artemis, and BlackBoard Artemis ATP) blinking in less than 5 minutes using the SparkFun Artemis Arduino Core!

Artemis Development on Arm® Mbed™ OS (Beta)

With the latest Artemis DK, board, we now offer full Bluetooth support within the Arduino IDE and development with Mbed™ OS. While we have worked tirelessly to get the Artemis module supported in the next Mbed™ OS release, the next release isn't slated until after the Artemis DK becomes available to the public. Therefore, this post will provide users with a jump start for developing with Mbed™ Studio, prior to the next release (in a beta of sorts), by utilizing our fork of Mbed™ OS.

Example Projects

Programming the SparkFun Edge with Arduino

Running low-power machine learning examples on the SparkFun Edge can now be done using the familiar Arduino IDE. In this follow-up to the initial Edge tutorial, we'll look at how to get three examples up and running without the need to learn an entirely new SDK.