Homemade Digital Oscilloscope

3 comments
ATMega162 based homemade digital oscilloscope project with a sampling rate of 40MSPS and 5MHz maximum input frequency.



An oscilloscope is one of the most important tools that should take place on a electronics hobbyist’s workbench. But most of the commercial oscilloscopes are often too expensive. This LCD screen homemade scope features;
  • 40 Mega samples per second
  • 5 MHz input frequency
  • 10 MHz max. frequency displayed without aliasing
  • 20 MHz input circuit bandwidth
  • 40mV/div sensitivity
  • DC coupling
  • 10 KOhm input impedance
  • 240×128 total, 200×125 trace resolution
  • 9V – 1A power source
  • Digitally adjustable trigger and trace offset.
Main part of the circuit is Atmel ATMega162 microcontroller. OPA2652 and RF filter pair sets the BW to 20MHZ. 8 bit 60MSPS ADS830 IC is used for the analog to digital conversion. The digital output is connected to a high speed FIFO memory.
Read more ►

Simple signal drawing on graphical LCD

0 comments
During spare time I have been playing with graphical LCD. This time I decided to display simple signals that are stored in microcontroller memory. The idea was to read signal values from look-up table and display waveform on Graphical LCD. To make things more interesting I divided LCD screen in to smaller four screens so I could activate them separately and draw signals in them.


Graphical LCD is the same old HQM1286404 with KS0108 controller. I have used Proteus simulator 128×64 graphical LCD(LGM12641BS1R) which is based on KS0108. How to implement and connect LCD there was a blog post (Simulate KS0108 graphical LCD with Proteus simulator)about it. I am just going to show main program routine.


As I mentioned I have split 128×64 in to four smaller screens like this:
Read more ►

Programming AVR ADC module with WinAVR

0 comments
Most of AVR microcontrollers have Analog to Digital Converter (ADC) integrated in to chip. Such solution makes embedded designers life much easier when creating projects and programming them. With no need external ADC PCB takes less space, easier to create programs – it saves time and money. As an example lets take Atmega8 microcontroller which have up to 8 ADC inputs most with 10-bit resolution(excluding ADC4 and ADC5 inputs that are 8-bit). All features of AVR internal ADC can be found on official ATMEL AVR datasheets, but most important to mention are:
  • ±2 LSB accuracy – so measurements aren't very accurate. If AREF voltage is 5V then error may reach ±0.04V but this is still good results for most of tasks;
  • Integral nonlinearity ±0.5 LSB;
  • Conversion speed up to 15kSPS at maximum resolution. This is far not enough for 20kHz audio signal sampling.
ADC unit is powered with separate power supply pins AVCC with AGND, but AVCC must not differ ±0.3V of VCC. Also ADC unit can have different voltage reference sources selectable in ADMUX register. References may be taken from AREF pin, AVCC with external capacitor or internal 2.56V voltage reference. All ADC inputs are multiplexed via multiplexer. Each channels can be selected by changing 4 bits in ADMUX register. ADC unit can operata in two modes:
Read more ►

SD/SDHC Card Interfacing with ATmega8 /32

0 comments
Here is my project on interfacing of SD Card (microSD). microSD cards are available very cheap nowadays, a great option for having a huge memory in any embedded system project. It is compatible with SPI bus, so the interfacing is easy. SD card adapters are also easily available in market, one can easily make a bread-board adapter by soldering few pins on it. Following figures show the SD card pin-out & the bread-board adapter design by soldering 7-pins of a breakout header on the microSD adapter (Click on images for larger view).

I had started this project with 1GB microSD card from SanDisk (later on tested with transcend cards also). The microcontroller is AVR ATmega8 or ATmega32 running at 8Mhz internal clock. MAX232 is used to interface the circuit with PC for monitoring the data. A 3.3v supply is used for powering the mega8, microSD and max232 (though the specified supply for max232 is 5v, it works comfortably at 3.3v).7 pins of the microSD are used here, shown in the figure of pin-out.


Schematic for ATmega8 is shown here (updated on 10 May 2010, SD series resistors are removed, as they were limiting the speed of SPI bus. 51k pullups are added on CMD/DAT lines. This gives better stability with different cards. Also, two 3.6v zeners are added to protect SD in case when the ISP programmer voltage levels are of 5v. these diodes are not required if your programmer has settings for 3.3v output)
(Note: VCC & GND pins of MAX232 are not shown in the schematic, but they must be connected in the actual hardware)

Following is the schematic for ATmega32, without RTC (updated on 10 May 2010):


Following is the schematic for ATmega32, with RTC (added on
17 May 2010). Here two supply voltages are used, 3.3v for SD & 5v for remaining ICs.


The aim of this project was to learn interfacing of SD card and to understand the data transfer in raw format as well as in FAT32 format. I started with raw data transfer, sending some data to any block of the microSD, reading a block of it, reading and writing multiple blocks, erasing multiple blocks. All this in raw format. I used RS232 for viewing the data read by microcontroller from SD card. The uc sends the data to HyperTerminal. Similarly, to write data to card, the data was fed thru HyperTerminal, by typing some text.
Read more ►
 

Copyright © nhbinh1985 Design by O Pregador | Blogger Theme by Blogger Template de luxo | Powered by Blogger