Quantcast
Channel: SparkFun Tutorials
Viewing all articles
Browse latest Browse all 1123

Artemis Development with Arduino

$
0
0

Artemis Development with Arduino a learn.sparkfun.com tutorial

Available online at: http://sfe.io/t911

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. Whether you are using one of our boards that has the Artemis module pre-integrated or have your own, this tutorial will show you how to install SparkFun's Apollo3 Arduino core and get you up and blinking in less than 5 minutes!

SparkFun Artemis Module - Engineering Version

SparkFun Artemis Module - Engineering Version

WRL-15376
$8.95

Required Materials

To follow along with this tutorial, you'll need one of the following Artemis carrier boards such as the BlackBoard, BlackBoard Nano, or BlackBoard ATP and a USB C cable.

USB 2.0 Cable A to C - 3 Foot

USB 2.0 Cable A to C - 3 Foot

CAB-15092
$3.95
BlackBoard Artemis

BlackBoard Artemis

SPX-15332
$19.95
BlackBoard Artemis Nano

BlackBoard Artemis Nano

SPX-15411
$14.95
BlackBoard Artemis ATP

BlackBoard Artemis ATP

SPX-15412
$24.95

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.

Installing Arduino IDE

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

Designing with the SparkFun Artemis

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

Arduino Installation

With the Arduino Board Manager, installing new board support within your Arduino IDE is a breeze!

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.

Installing the Arduino Core for Apollo3

We've built the Arduino core for Apollo3 from scratch, making it as lightweight and easy to use as possible.

To install the SparkFun Apollo3 Arduino Core:

  • Open the Arduino IDE (must be v1.6.12 or later)
  • Navigate to Preferences
    Arduino Preferences, under File

Having a hard time seeing? Click the image for a closer look.
  • In the "Additional Board Manager URL" box, add

    language:c
    https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json
    

Additional Boards Manager URL location in the Preferences Dialog

Having a hard time seeing? Click the image for a closer look.
  • Go to Tools>Board and select the Boards Manager

Arduino Boards Manager Dialog, under Tools

Having a hard time seeing? Click the image for a closer look.
  • Search for "Apollo", and you should find the SparkFun Apollo3 board package.
  • Make sure the latest version is selected and click Install

Board manager showing SparkFun Apollo3 Artemis install

Having a hard time seeing? Click the image for a closer look.

Installation may take a few minutes -- included in the install are all necessary source files for the Arduino core and Apollo3 libraries, plus all of the compiler and software-upload tools you'll need to use the Artemis with Arduino.

Once the board definitions have been installed, you should see a new set of Artemis boards under your Tools > Board menu.

List of Artemis boards

Ahh, the most basic of examples - Blink. Now that you've got your board definitions installed, select your board from the Board Managers pulldown and choose the correct USB port. You can load the blink example by clicking on File->Examples->01.Basics->Blink.

The Blink Sketch is under file->examples->01.Basics->Blink

Hit the upload button and enjoy the blinky goodness!

Beyond Arduino

The SparkFun Apollo3 core supports all the standard Arduino functions. This means you can program digitalWrite I/O, analogRead ADC pins, Serial print to the Serial monitor, interact with hardware serial using Serial1, and even perform more complex I2C or SPI writes with the Wire and SPI libraries. The basics are there, so let's dive in to some more advanced capabilities of the Artemis!

Ambiq has created a software development kit to fully flex the Apollo3. The Ambiq SDK contains a large number of examples and demonstrates all sorts of incredible aspects of the Apollo3. Each example uses various functions that look like this:

Various HAL functions

These long-named-functions are part of what's called a HAL or hardware abstraction layer. We aren't going to go into the specifics of setting up or using the SDK right now, but just know that the the SparkFun Arduino Apollo3 core is built upon this HAL which means you can call HAL functions directly inside the Arduino environment.

language:c
// Clear the RTC alarm interrupt.
am_hal_rtc_int_clear(AM_HAL_RTC_INT_ALM);

Ambiq HAL inside the Arduino IDE

This is a powerful tool for advanced users; you can use the built in Arduino functions such as Serial.begin(9600) and delay(100) while integrating more advanced HAL functions for controlling things like interrupts.

If you do decide to dig into the SDK, head on over to our Using SparkFun Edge Board with Ambiq Apollo3 SDK tutorial for more information!

Using SparkFun Edge Board with Ambiq Apollo3 SDK

March 28, 2019

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.

Troubleshooting

Resources and Going Further

And lastly, Artemis has been designed and proven to work with our entire range of 50+ Qwiic boards. Be sure to checkout and get inspired by what's possible by just plugging in the sensors and outputs you need to build something amazing!

SparkFun Transparent OLED HUD Breakout (Qwiic)

SparkFun Transparent OLED HUD Breakout (Qwiic)

LCD-15079
$99.95
SparkFun GPS-RTK2 Board - ZED-F9P (Qwiic)

SparkFun GPS-RTK2 Board - ZED-F9P (Qwiic)

GPS-15136
$219.95
8
SparkFun Qwiic OpenLog

SparkFun Qwiic OpenLog

DEV-15164
$16.95
SparkFun Capacitive Touch Slider - CAP1203 (Qwiic)

SparkFun Capacitive Touch Slider - CAP1203 (Qwiic)

SEN-15344
$5.95

learn.sparkfun.com | CC BY-SA 3.0 | SparkFun Electronics | Niwot, Colorado


Viewing all articles
Browse latest Browse all 1123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>