|
A $55 Webcam
by Steve
Freyder, David Helland,
& Bruce LIghtner
Start
Hardware Design Picking
a Camera Cheap CMOS Cameras
PicoWeb Server Hardware Firmware
Functions Software Design
PicoWeb Firmware Java
Applet Smile Source
and PDF
PicoWeb Server Hardware
The PicoWeb server uses the Atmel AT90S8515
microprocessor because the architecture is quite sophisticated for
a processor of this size and cost. All of the registers are directly
available (not mapped, as in the 8051) and the memory address space
is linear (not segmented into pages, as in the PIC).
The AT90S8515 is a low-power RISC processor
with 8 KB of flash program memory, 512 bytes of EEPROM, 512 bytes
of RAM, 32 I/O lines, and a built-in UART. With an execution rate
of one instruction per clock and a clock rate of 8 MHz, the AT90S8515
can drive the PicoWebıs 10BaseT Ethernet controllerıs I/O bus at 1
MBps. The PicoWeb server includes a 16-KB serial EEPROM chip to hold
things like GIF and JPEG images as well as things like HTML, text
files, and Java byte-codes. You can see a photo of the commercial
version of the PicoWeb server in our "$25 Web Server" article.
The schematic for this version of the PicoWeb server can be found
in Figure 3.
| Figure
3ıThe commercial version of the $25 PicoWeb server uses
a Realtek NE2000 Ethernet controller chip instead of a PC ISA-bus
NE2000 Ethernet card. Everything else remains the same. |
The PicoWebıs Ethernet controller is
a Realtek RTL8019AS, a single chip NE2000-compatible device with 16 KB
of on-chip packet buffer RAM. This chip only needs a transformer,
a single resistor and a few capacitors to implement a complete 10BaseT
Ethernet network connection. The PicoWebıs DB-25 connector has up
to 16 free general purpose digital I/O lines, an RS-232 serial port,
and an in-circuit flash-memory programming port. An onboard voltage
regulator accepts either AC or DC power in the range of 7 to 25 V
. Typical current consumption is under 30 mA from the 5-V DC supply.
An NE2000 Ethernet chip is optimal because
the Atmel processor memory is limited. The NE2000 controller has 16
KB of onboard SRAM that functions as a ring buffer to allow unattended
reception of back-to-back Ethernet packets. (Because the commercial
version of the PicoWeb server operates the Realtek chip in 8-bit mode,
the available buffer RAM is reduced to 8 KB.) The same onboard Ethernet
controller SRAM can be used to assemble transmitted Ethernet packets.
The result is that the Atmel microcontrollerıs meager 512 bytes of
on-chip SRAM is not needed to send or receive the maximum-sized 1500-byte
Ethernet packets.
Connecting the camera to the PicoWeb
server is simple, as Figure 4 illustrates. The data connection to
the camera is a mini-stereo jack. The cable that comes with the camera
(not used in our application) has this jack on one end with three
wires (TX, RX, GND) that connect to a PC-compatible DE-9S serial connector
on the other end.
 |
| Figure 4ıA simple 5-wire cable
connects the PicoWeb server to the Mattel digital camera. Adding
a power connector to the cameraıs body means the camera can
be powered from the same 9-VDC supply as the PicoWeb server. |
A 9-V battery normally powers the camera,
supplying a 5-VDC regulator chip inside the camera. We disassembled
our camera and drilled a hole to add a power plug so we could power
it off of the same unregulated 9-VDC supply as the PicoWeb. The PicoWebıs
unregulated DC is available on a pin in its DB-25 connector. The camera
only draws 70 mA from this connection. (We tried powering the cameraıs
logic board directly from the PicoWebıs regulated 5-VDC power supply,
but the camera kept warning us about its (missing) "low"
9-V battery!)
The images stored in the camera are located
in its RAM, so removing the battery or disconnecting the DC cable
from the PicoWeb will result in the loss of any stored images. To
keep the camera from turning itself off to save its (now missing)
9-V battery, we programmed the PicoWeb to probe the camera over the
serial port, about once per second. Modifying the standard PicoWeb
clock frequency (from 8 MHz to 7.372 MHz) derived the 57.6 kbps rate
needed by the camera.
PREVIOUS
NEXT
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ıCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |