Circuit and working
The heart of the project is ATmega16 microcontroller—a low-power CMOS 8-bit chip based on AVR enhanced RISC architecture. It has 16kB in-system programmable Flash memory, 512 bytes of EEPROM and 1kB SRAM. A 16MHz crystal is connected across its pins 12 and 13 to provide basic clock. An R-2R ladder network DAC (digital-to-analogue converter) is used to convert digital (8-bit) values from the microcontroller to analogue values that are input to the oscilloscope.
The software is written in C language and compiled using Programmer’s Notepad of WinAVR software. The hex code is burnt in the microcontroller using a suitable programmer. The fuse settings for ATmega16 are:
The code is written such that it accepts byte codes in pages and columns format. The byte codes of the image is in the intel array which is stored in Flash memory. The myte array stores the pixel data of 32 pixels along a column, indicating the on/off states. On state is represented by a value of 1 to 31 and an off state by 0. The vertical trace movement is synchronised by the 20µs delay from one column to the next. The details are given in comment lines of the code.
The loop is repeated continuously as there is no DDRAM (data display RAM) to store the pixel information. So, for persistence of vision, the trace is repeated continuously for a certain number of cycles (50 here in the code). More than one image can be stored in new arrays until the Flash memory saturates.
The trace of the oscilloscope runs with internal trigger set at 10ms (time/div). The trace is set at this value for proper persistence of vision and in synchronisation with the timing of the code for proper display.
The analogue values are applied to the y-input of the scope. Each of the 32 pixels across a single column in the screen is assigned a particular voltage level (digital values from 0 to 31) as seen in the code. By switching the values from 0 to 31 very fast, we form a pixel of 32 dots across a single column. As the trace moves horizontally, it forms an array of pixels across the screen having 32 rows. This is how the pixel array is generated on the screen. The 32 pixels across a single column constitute 4 bytes. By individual switching of the pixels across a column till the trace moves to the next column, an image can be displayed.