Issue
143 June 2002
Still
Swimming With the STK500
Onto
the JTAG ICE
by
Fred Eady
ATMEGA16
IN CHARGE
The
final step of the AVR Internet project takes the ATmega16
from the STK500 development board and mates it with
an appropriate Internet-capable interface. I’ll couple
the ATmega16 loaded with a minimal TCP/IP stack and
Telnet application with a Packet Whacker and a backlit
LCD. The Packet Whacker is a microcontroller NIC based
on the Realtek RTL8019AS that will allow the ATmega16
to interface with a router in the Florida room that
is attached to the Internet. For those of you not familiar
with the Packet Whacker, there’s lots of Packet Whacker
info on the Circuit Cellar web site. The LCD
will be accessible to you via a Telnet session from
wherever you may be, 24 hours a day, 7 days a week.
I recently installed a higher resolution web cam on
my web site at www.edtp.com and have it pointed at the
ATmega16 Internet device you see in Photo 6. A server
is dedicated to putting pictures of the ATmega16/ Packet
Whacker Internet device from that web cam on the Internet
for you. The idea is to allow you to use a Telnet session
to write to the LCD that is being controlled by the
Atmega16/ Packet Whacker Internet device. The web cam
puts you there live as you are interfacing with the
LCD.
|

(Click
here to enlarge)
|
Photo
6—The Packet Whacker is a real microcontroller network
interface card (NIC) that’s plugged into a virtual
slot on the ATmega16. |
As you can see from Figure 1, the Packet Whacker takes
much of the complexity out of the hardware design. I’m
using an LCD as an output device, but the idea behind
it all is that you can do anything with the output pins
that are not being used by the Packet Whacker NIC.
|

(Click
here to enlarge)
|
Figure
1—There isn’t much here to call play-by-play. The
Packet Whacker is a self-contained NIC module that’s
interfaced to a self-contained TCP/IP-enabled microcontroller. |
Using the Atmel ATmega series of micros makes this project
easy to modify as far as a microcontroller is concerned.
You could substitute an ATmega128 in the schematic for
the ATmega16. The ATmega128 would give you an additional
23 I/O lines and 3 KB of extra SRAM buffer area, and
you wouldn’t have to change a significant amount of
the original Internet device code to squeeze it in.
If your Internet device doesn’t need the resources of
a more complex microcontroller, you don’t have to put
them there, but if you really want to rock and roll,
you can shoehorn the big ATmega128 motor in.
The final working AVR TCP/IP code is a port of various
algorithms I have assembled on other microcontrollers
over time. Unlike some of the micros I ported this code
from, the AVR ATmega16 architecture is designed to lean
towards programs written in high-level languages like
C. As a result, I was able to eliminate all of the assembly
language routines from the ported code and write them
fully in AVR C using ImageCraft’s ICCAVR Professional.
The AVR code is basically a combination of modules that
perform a specific Internet-related function. All of
the basic functions are there including a limited TCP
module. For instance, an ARP module is included in the
AVR code to allow other devices on the Internet or LAN
to establish a communications session with the AVR Internet
device.
IN
THE PIPE
I’ve
enjoyed putting this series on the Atmel development
tools and JTAG ICE together. The Atmel gear I’ve been
exposed to is inexpensive and top notch. I look forward
to seeing you on the AVR Internet device LCD, and when
I do, we will have proven that the ATmega16 isn’t complicated.
It’s embedded.