By Fred Eady
Experience the Emperor Pinguino
If the word “Arduino” is foreign to you, odds are that you’ve been exiled to a
hole in the ground in the unexplored depths of the Amazon jungle. I recently
came face to face with an Arduino while helping some senior aeronautical
engineering students complete their senior design project. Not one of the
aeronautical-engineers-to-be considered themselves as “programmers.”
However, they all adapted to the Arduino environment quite handily.
The Arduino platform the students used intrigued
me as I witnessed a bunch of college kids take an
unknown entity, learn to use it, and apply it to
their control application. I decided to take a
serious look into the “Arduino effect.” Arduino is
touted as an open source platform and I was
pleased to find a couple of Arduino variants that
were out of the ordinary. The Arduino variant
that caught my eye is really not an Arduino
platform at all. It is called Pinguino.
I’m not going to get up on my donkey and make the
assumption that all of you reading this are intimately
familiar with the Arduino environment and the physics that
make it work. In that Pinguino is Arduino-compatible, we’re
going to concentrate on getting Arduino-like results from
Pinguino hardware and software. Currently, Pinguino
hardware is based on the PIC18F2550 and PIC18F4550.
Pinguino software is very similar to the Arduino and is built
from open source packages.
Although the results of AVR-based Arduino designs are
for the most part identical to the results one would expect
to receive from a Pinguino design, the Pinguino hardware is
very different in content. A typical piece of AVR-based
Arduino hardware is based on an Atmel ATMega8,
ATMega168, or ATMega328. Larger AVR microcontrollers
are also being integrated into the Arduino environment. As
of this writing, the flagship Arduino board is the Uno which
is based on the ATmega328. The new Arduino Uno differs
from its ancestors in that the FTDI USB-to-UART IC has been
replaced with an ATmega8U2 USB-enabled microcontroller.
The advantages of using an AVR instead of the FTDI part
are speed and USB class flexibility. The new Arduino
platforms that are front-ended with a USB-equipped
microcontroller can be configured as HID-class USB devices,
as well as CDC-class devices.
You can beat the AVR and PIC datasheets against each
other to pull out the fine points of differences in the
microcontrollers. However, in a nutshell, the Pinguino
platform is based on a USB-enabled PIC and does not
require an additional USB front-end device. The PIC18F2550
is a 28-pin USB-enabled PIC and offers up to 18 I/O pins
that fall under the control of the Pinguino environment. The
PIC18F4550 is available in 40-pin DIP and 44-pin TQFP
packages and — if you include the RUN LED I/O pin —
brings 30 I/O pins to the Pinguino party.
The Pinguino environment is designed to operate with
the same C-type mnemonics used in the Arduino
programming environment. That makes sense as the
Arduino and Pinguino are both based on open source code.
Both the Arduino and Pinguino platforms leverage open
source to allow them to run on all of the popular operating
systems which include Linux, MAC OSX, and Windows XP/7.
As I alluded to earlier, the Pinguino programming
language is very similar to C. However, there is no C main
function. The C main function is replaced by a loop
function. A setup function is also part of the Pinguino
programming model. The setup function runs only once
following a hardware or power-on reset. Here’s a super
simple example of how the setup and loop functions are
used to blink an LED attached to one of the Pinguino
microcontroller’s I/O pins:
SERVO 01.2011 49