You Are Here: Home » AVR ATmega Projects » Minimum Mass Waveform Capture and Display using AT90S2313 microcontroller

Minimum Mass Waveform Capture and Display using AT90S2313 microcontroller

A 128 x 64 graphic LCD is in the clear plastic box at the top.
It is connected to the waveform capture and control unit in the

green pencil box below the display.


AVR Studio 3.5  ASSEMBLY SOURCE for the waveform capture controller.
AVR Studio 3.5  ASSEMBLY SOURCE for the control panel and LED Display controller.

Also needed: Circuit and Firmware to support and interface the Seiko-Epson G116 display.

Even before I finished the waveform capture circuit , which is separately describe in these web pages, I started thinking about making an oscilloscope-like instrument with it. I have enough respect for what goes into the design of a real digital oscilloscope to not even pretend this comes close. It has limited bandwidth, a sampling rate of only 1 MHz, and no anti-aliasing filtering. I do, however, find this tool very useful for observing repetitive waveforms. For example, I have used it to measure the ringing frequency of some LC networks and to diagnose a firmware problem that was the source of trouble on a micro controller’s output pin.

The result was a project that includes a waveform capture circuit, a graphic LCD (Liquid Crystal Display) and a control panel with LED indicators. The details of the Graphic LCD display unit, composed of the LCD module, a serial interface, and bias supply were published earlier on this site, and you can see it HERE. As described, the display plugs directly into the waveform capture and control unit, which is what the what the rest of this page is dedicated to.

 Waveform Capture and Control Unit

Waveform capture and control unit

On the left hand end of the Waveform Capture Unit circuit board is the the microcontroller that interfaces the input buttons and LED clock display to the Waveform Capture controller on the right hand end of the board. In the middle are the comparator and quad op amp used in the analog signal processing and triggering circuit. Along the bottom edge of the board is the interface to the control panel. Along the top edge are (left to right) connectors for the LCD Graphic display, unregulated +8 volt power in, signal and trigger signal inputs, and a ground point for troubleshooting.

The board contains all of the analog circuit including the +5 volt power supply as well as the waveform sampling circuit and control panel interface with LED display. A clock display picked up surplus is used to display the sampling rate and it is driven by the control panel controller. A separate LED mounted just below the clock display indicates that the sampling is being triggered and is driven directly by the analog circuitry.

The control panel controller appears as an ASCII terminal to the waveform capture controller and the two chips communicate using their on-chip hardware UARTs at 9600 baud. Both the controllers are Atmel AT90S2313. The control controller could have been implemented using an AT90S1200 but it was a little easier with the AT90S2313 because it has a hardware UART and a luxurious RAM stack, and by the time I came that part of the project I was much more anxious to see waveforms than to see if I could use the lower cost processor.



The waveform capture and control and indicator unit only uses four easily
obtainable integrated circuits. The only part that might be tout of the ordinary for
a lot of people is programming the AT90S2313 microcontrollers.

The circuit is straight forward, having few frills.. Indeed, all of the input signal processing circuitry like the DC/AC coupling switch, 10:1 voltage divider, and the X10 gain amplifier could be left off entirely, as could the trigger circuit and trigger indicator and the button and display controller, leaving only the bare bones converter in a single AT90S2313 that can be controlled through and ASCII terminal. The “extra” circuitry was added to meet my expected near-term modest needs.

Waveform signal circuit
AC coupling through the two 0.33 uf capacitors in series gives a time constant on the input of about 2 seconds -may be a little long for some applications. The easiest way to shorten it is to replace the series capacitors (there are two of them because the ones in this range that I have on hand are tantalum) with a nonpolarized capacitor with a suitable voltage rating.

The 10: 1 divider on the input circuit is frequency compensated with a single 5 pf capacitor to ground. I used parts I had on hand. If you are picky, you can use metal oxide resistors to get a more precise and stable divider, but remember this is only a 6 bit waveform monitor.

The ideal case when the divider switch is in the “X1/10” position is for the capacitance across the 10 Meg Ohm resistor to be 1/10 the capacitance from the top of the 1 meg Ohm resistor to ground. A good practice is to place a relatively large resistor from the top of the 1 meg resistor to ground, say 10 or 15 pf, and then select or adjust a trimmer across the 10 meg resistor. This is exactly how a X10 scope probe works, and if you are so inclined, you could skip the 10:1 divider, ground the bottom of the 1 meg resistor (short the 100k), run the top of the 1 meg straight to a BNC connector and use it with either a X1 or X10 scope probe. If you do this you might have to increase the 5 pf capacitor a little bit to get a high enough shunt capacitance for the scope probe’s frequency compensation to work.

The 10k resistor serves to limit the current into the gate of the FET for large positive signals, and to limit the current into the 1N916 for large negative signals, thus protecting the circuitry. There is still some susceptibility, however, because of the shunt capacitance across the 10k resistor, so don’t go probing the output of a fluorescent LCD backlight with this.

The FET in my circuit is an MPF102 but you can probably use any one of many JFETs you have around. The FET must be selected to provide a suitable shift in the DC level of the input signal when the input is grounded. Try for 2.5 volts ± 1 volt, to allow some room for the signal. The LM324 operates from the unregulated power supply to provide a little extra latitude in this operating point, but remember to keep the input level, which can be 1 volt P-P or more plus the offset to well below 4.5 volts DC where the differential gain of the comparator on the AT90S2313 gets to be too poor even for 6 bit operation. The value of the 15k source follower resistor can also be varied to obtain the necessary level shift. If the resistor gets too large, the bandwidth might suffer noticeably, and if it is made to small, then a lot of the input signal will be dropped across the source resistance, thought there is quite a bit of adjustment range in the waveform capture circuit itself to make up for quite a bit of this loss.

A X10 direct coupled amplifier is implemented with an LM324. The LM324 has a gain-bandwidth product of 1 MHz, so the 3 db corner frequency of this X10 amplifier is 100 KHz, which is acceptable tradeoff given the LM342’s ability to operate from a single +5V power supply and low cost. The gain of the amplifier is set by the 62k and 6.8 k resistors. The gain comes out pretty close at 10.1:1, so it would only be 1% off if the resistors were right on value. The bottom of the feedback divider made of the 62k and 6.8k resistors connects to the voltage follower made from another section of the LM324, and this voltage follower appears as if it were a ground at about 2.5 volts, which is appropriate given that the input signal was level shifted up by 2.5 volts by the source follower. The input to to the voltage follower is set by a coarse (10k pot) and a fine (50k pot) offset adjustment.

The 2N2907 connected across the 62k feedback resistor in the X10 amplifier serves to limit the circuit’s maximum output voltage swing to just above the +5V supply. This is because the LM324 is powered from the unregulated +8 volt input and could otherwise swing well above the +5V power supply, which could be bad for the input of the AT90S2313. Note that in a higher resolution application, where noise was more of an issue, noise on the 5 volt supply coupled to the inverting input of the op amp though the transistor’s collector to base capacitance could be a problem and in that case it would be better to decouple the base from the power supply with a small resistor and a small capacitor.

Trigger circuit

The trigger circuit couldn’t be much more straight forward. The trigger signal, whether from the external trigger input or the waveform signal itself, is compared to a trigger level set by the trigger level potentiometer. The resulting sliced signal is applied to the trigger input of the waveform capture controller. The signal is also AC coupled to a detector made from the remain half of the dual comparator. Whenever a pulse swings above 2.5 volts, as set by the two 470k resistors, the output of the comparator dumps the change on the 0.33 uf capacitor on its output to ground. The purpose of the 1k resistor in series with the capacitor is to limi the peak current on the output of the comparator to 5 miliamps. A 100k resistor charges the capacitor back up slowly and the voltage across the capacitor drives an LED through a voltage follower made with a 1/4 of the LM324. The more the capacitor is kept low by trigger pulses, the more the LED is on, thus the LED serves as an indicator that the trigger circuit is sending trigger pulses to the waveform capture controller.

The voltage on the wiper of the 10k trigger level potentiometer sets the level on the incoming waveform at which the trigger pulse starts. If The waveform were, as an example, a sine wave, the trigger level control would allow the circuit to smoothly vary the triggering time as the threshold traversed the amplitude of the sine wave. The selection of the positive or negative slope takes place in the microcontroller


For more detail: Minimum Mass Waveform Capture and Display using AT90S2313 microcontroller

Leave a Comment

You must be logged in to post a comment.

Read previous post:
Robotics – Bigdog a Military Bot participated in Afghan Battle

Big Dog is fantastic looking machine being created by Boston Dynamics. DARPA is funding development of Big Dog, they have also funded development of...

Scroll to top