June Birth Magoncia

user Electronics Engineer

city Innovuze Solutions, Inc.


  • ATmega32 Based Oscilloscope

  • Created: Apr 05, 2017

    • view143
    • comment0
    • bookmark0
    • fork0

Description

No description available.

Summary

This reference design features an oscilloscope which is based on an ATmega32 microcontroller. The ATmega32 is a 40-pin device with 32 programmable I/O lines that operates with a 5V power supply. It has 32KB program memory, 1KB EEPROM, and 2KB internal SRAM. The ATmega32 microcontroller comes with an ADC, I2C, SPI, timers, USART, and other peripherals. In this design, its 10-bit ADC is used to determine the voltage level, waveform, and frequency of the signal.


The circuit is powered by a 12V power supply. A V7805-2000R DC-DC converter regulates the 12V input to 5V to supply the ATmega32 microcontroller and the LCD. An 8.2V Zener diode also regulates the 12V input to power the LM358NG operational amplifiers. This oscilloscope can measure from -2.5V to +2.5V for AC signals and 0 to +5V for DC signals. The type of current to be measured is selected through switch S3. The input voltage can be doubled by closing the switch S2. The op-amps buffer the signal from the input and send it to the ADC of the ATmega32 through pin PA0. The circuit doesn't have any hardware triggering. The triggering function is done through the program. The triggering relies on the samples captured by the ATmega32. The ATmega32 gets up to 15K ADC samples and calculates the middle value of the signal. The number of captured samples depends on when a full period is completed. The microcontroller starts capturing new samples again and compares the new sample with the previous sample. If the new sample value is lower than the previous sample then the microcontroller captures new sample again. If the new sample is higher than the previous sample, it means that the waveform is rising. Then the microcontroller checks if the value of the new sample is higher than the middle value. If it is higher, the beginning of the waveform has been found and the microcontroller starts capturing the next 100 samples into the RAM. The ATmega32 prints the 100 samples on the LCD and goes back again to the first step. The ATmega32 must start from the first step since the peak-to-peak voltage of the signal can change when the input waveform changes. The middle value of the signal will also change if the signal's waveform changes.


There are two trimmers in the circuit that can be used for calibration. The trimmer RV1 is used to move the beam at the center of the LCD while RV2 is used to adjust the LCD contrast. On the LCD, one square height is equivalent to one volt. To measure the voltage of the signal, the pushbuttons S6 and S9 can be used to move the beam down or up, respectively. The measurement speed of the oscilloscope can be decreased or increased through pushbuttons S5 and S8. The pushbutton S5 extends the waveform while S8 shrinks it. For signals that are unstable, the pushbutton S7 can be used to freeze the screen so that the user can capture a picture of it. This oscilloscope can be used for digital signals with 7.7kHz maximum frequency. For other waveforms like sine or triangle, the frequency is limited to 1kHz only to have a clear view of the signal.