LCS-1M - A Low-Cost Hobby Oscilloscope
|Click on the image for a larger view
The Microcontroller is the heart of the oscilloscope. It controls
all the other parts of the circuitry. I chose the Picaxe 28X1 (from
www.picaxe.com), which basically is a Microchip 16F886 with
built-in bootloader and Basic interpreter. While this makes it a
bit more expensive than the raw PIC it is based on, the
advantage is that you don't need to buy or build a separate
programmer to burn the scope firmware - which makes it
much more beginner friendly and also saves money overall.
The firmware download circuit consists of just three resistors (R2, R3, and R4). The download cable,
a simple RS-232 serial cable (also available from the Picaxe vendor) ending in a stereo phono plug,
which gets re-used during normal operation as the connection between scope and PC - again
reducing overall cost.
Because the microcontroller itself doesn't have enough I/O's by itself, I added a Maxim I/O expander
(MAX6956 or the pin-compatible MAX7300), which gives 20 additional I/Os. These are mostly used to
transfer the sample data from the scope's SRAM memory, as well as for chip enables for the DACs
and programmable gain amplifiers that the microcontroller talks to via an SPI bus. The
communication between the microcontroller and the I/O-Expander is through an I2C bus (the Picaxe's
program execution is relatively slow, and the I2C version of the expander results in less commands to
send compared to the SPI version).
There is a jumper to switch between firmware download and regular connection. In principle we could
use the download connection to transfer commands and data during normal operation as well, but
this connection is a "software UART", i.e. the microcontroller has to bit-bang the data, and in addition it
uses CMOS levels (0 to 5V) instead of standard RS-232 levels (-15 to +15V).
On the other hand, switching to the other jumper setting connects the mocrocontrollers to the
hardware USART port, which can run in the background, i.e. the data byte gets transferred in the
background while the microcontroller can already perform the next operation. This speeds up the
frame rate (maximum number of scope screen refreshs per second) by more than half. In addition it
uses a MAX232 level converter that converts between the CMOS levels to/from the Microcontroller and
the RS-232 levels to/from the PC, and also adds a layer of protection between scope and PC (after all,
you may accidentally connect your scope to a high voltage, and that shouldn't fry your PC as well!).