Hardware Reference
In-Depth Information
Chapter 9
Using Arduino with PIC32 and
ATtiny Atmel Chips
Transitioning from standard to custom Arduino hardware can save space and money. Custom boards can add new
capabilities to projects through increased speed, memory, and pins, as well as new features. This chapter will look
at chips and boards on a spectrum from the power and complexity of the Leonardo to the inexpensive simplicity of
the ATtiny. It will examine the unique capabilities of the chipKIT environment based on the Microchip's PIC32 series
micro-controller. Then the chapter will demonstrate some unique libraries and features of the chipKIT environment,
including support for scheduling timers, which make object detection with Infra-Red (IR) simple. As an example
using the Atmel ATtiny environment, you will program a secret knock to operate a servo motor, which will open and
close a small wooden box.
Arduino and Nonstandard Environments
Arduino is both a physical specification and a software abstraction layer. Since the Arduino API functions so
effectively, it has been ported to many different platforms and microcontrollers. chipKIT is one of the earliest of these
platforms and the first one that supported compiling code for both itself and Arduino. Multiplatform Arduino means
that that the Arduino environment can compile code for multiple families of different chips. The multiplatform IDE
(MPIDE) can compile Arduino code for Atmel chips and the multiple-platform PIC32.
There is now a broad choice of Arduino-compatible options, including faster and slower chips, with a range
of available numbers of pins, and a variety of other features. This spectrum of complexity results in a spectrum of
price points. For example, the Arduino Due has an ARM Cortex 3 chip that enhances Arduino performance and has
capabilities at similar levels to that of the chipKIT.
These high-performance options work best for some purposes. For example, such an option would be ideal if
you were trying to create a project that causes 26 small boxes to blink Morse code, listen with piezos, or unlock boxes.
You could customize the projects to include a low-cost chip that has a custom circuit board to make the project
affordable. Using these additional environments through the Arduino API allows you to use a high-end prototype.
With the Arduino advantage of quick code prototyping, you can make a smooth transition for porting a project from
a standard Arduino Uno and put the project on a smaller and less expensive ATtiny family of chips.
Lastly, I will be showing how to program smaller chips like the ATtiny85 from a standard Arduino. You will
examine how to make the Arduino a programmer for the ATtiny85 chip—a technique that can be used for the
entire ATtiny family, and for many other chips. You will also use the MPIDE to create a PIC32 Arduino-inspired
project.
 
Search WWH ::




Custom Search