Oscilloscope Program

Oscilloscope Program Average ratng: 3,9/5 5836votes

SpDVLuKibECclHUDo8jDDDD0zV9Cjvu9KTHOqqGzC8maQxKAeCjDg=h355' alt='Oscilloscope Program' title='Oscilloscope Program' />Make an Oscilloscope Using the Sain. Smart Mega. 25. 60 With the TFT LCD Shield and the 3. Touch Screen 8 Steps with PicturesBelow, you will find the sketch for the Oscilloscope. Before we copy and paste the program, lets review some limitations and explain the program. Ive had to do a fair amount of research to come up with the code, and many snippets have been borrowed from several sources. I divided the program into several subrutines to make it easier to understand. The code is well documented, but, if you have trouble understanding it, leave a comment and Ill try to explain it. The Oscilloscope bandwidth is limited to about 1 khz, but there is room for improvement. The input is limited to a 5volt peak to peak waveform, unless you use a voltage divider at the input, and also limited to positive waveforms from 0 to 5 volts. Oscilloscope. Project started on 20051221. Project completed on 20060114. First of all, many thanks to Professor Iravani for teaching us the analysis of linear. General Information Winscope 2. Konstantin Zeldovich and he has graciously distributed it as freeware. It was wrote for windows 95 but works happily. A tiny programmable dual channel realtime mixed signal USB oscilloscope and 8 channel logic analyzer for Linux, Windows and Mac OSX. Introduction Make an Oscilloscope Using the SainSmart Mega2560 With the TFT LCD Shield and the 3. Touch Screen. Oscilloscope Electronic Kits Modules Circuit Boards. Wide range for industrial, professional, educational and hobby applications. SOUND/osc_wio.jpg' alt='Oscilloscope Program' title='Oscilloscope Program' />Oscilloscope ProgramOscilloscope ProgramI used some code I found at http www. ADC sample time. The graphics and touch functions were modified, and borrowed, from the Henning Karlsen examples provided in his libraries. I used a LM 3. 17 voltage regulator, and a 5. IC timer as an astable ocillator, to create the signals used to test the oscilloscope input. Hope you enjoyed reading and hopefully building this instructable. If you find it useful, please vote for me in the contests. Note I included the s. Ketch, the UTFT and the UTouch libraries in the libraries. Copy and paste the sketch to your Arduino IDE START PROGRAM Program Oscopetouch. LCDmega. Description Digital Oscilloscope with data displayedon Color TFT LCD with touch screen. Hardware sainsmart mega. Software Developed using Arduino 1. This program requires the UTFT library and the. UTouch library from Henning Karlsen. Version 1. 0. 0Date 5 April 2. Author johnag include include Declare which fonts we will be usingextern uint. Small. Font Initialize Screen and touch functions. UTFT my. GLCDITDB3. S,3. 8,3. 9,4. 0,4. UTouch my. Touch6,5,4,3,2 Declare variableschar buf1. Input 0 byte Sample3. Old. Sample3. 20 int Start. Sample 0 int End. Sample 0 int Max 1. Min 1. 00 int mode 0 int d. Time 1 int tmode 0 int Trigger 0 int Sample. Size 0 int Sample. Time 0 int dgvh int hpos 5. Define various ADC prescalerconst unsigned char PS1. ADPS2 const unsigned char PS3. ADPS2 1 lt lt ADPS0 const unsigned char PS6. ADPS2 1 lt lt ADPS1 const unsigned char PS1. ADPS2 1 lt lt ADPS1 1 lt lt ADPS0 Start Subrutines draw buttons subvoid buttonsmy. GLCD. set. Color0, 0, 2. GLCD. fill. Round. Rect 2. 50, 1, 3. GLCD. fill. Round. Rect 2. 50, 5. 5, 3. GLCD. fill. Round. Rect 2. 50, 1. 10, 3. GLCD. fill. Round. Rect 2. 50, 1. 65, 3. Touch. data. Availablemy. Touch. read xmy. Touch. X ymy. Touch. get. Y delay5. Delay rowif x 2. Delay Buttonwait. For. It2. 50, 1, 3. GLCD. set. Color2. GLCD. draw. Round. Rect 2. 50, 1, 3. Select delay timesif mode 0 d. Time 0 if mode 1 d. Time 1 if mode 2 d. Time 2 if mode 3 d. Time 5 if mode 4 d. Time 1. 0 if mode 5 d. Time 2. 0 if mode 6 d. Time 3. 0 if mode 7 d. Time 5. 0 if mode 8 d. Time 1. 00 if mode 9 d. Time 2. 00 if mode 1. Time 5. 00 if mode 1. Trigger rowif x 2. Trigger Buttonwait. For. It2. 50, 5. GLCD. Color2. Select Software trigger valuemy. GLCD. draw. Round. Rect 2. 50, 5. 5, 3. Trigger 0 if tmode 2 Trigger 1. Trigger 2. 0 if tmode 4 Trigger 3. Trigger 5. 0 if tmode 5tmode 0 if y 1. H position rowif x 2. H position Buttonwait. For. It2. 50, 1. GLCD. Color2. GLCD. draw. Round. Rect 2. 50, 1. GLCD. clr. Scr buttons if hpos 6. For. Itint x. 1, int y. Touch. data. Availablemy. Touch. read draw grid subvoid Draw. Gridmy. GLCD. set. Color 0, 2. 00, 0 for dgvh 0 dgvh lt 5 dgvh my. GLCD. draw. Line dgvh 5. GLCD. draw. Line 0, dgvh 5. GLCD. draw. Line 2. GLCD. draw. Line 0, 2. GLCD. set. Color2. GLCD. draw. Round. Rect 2. 50, 1, 3. GLCD. draw. Round. Rect 2. 50, 5. 5, 3. GLCD. draw. Round. Rect 2. 50, 1. 10, 3. GLCD. draw. Round. Rect 2. 50, 1. 65, 3. Wait for input to be greater than trigger subvoid triggerwhile Input lt Trigger Input analog. ReadA01. 00 End Subrutines void setup my. GLCD. Init. LCD my. GLCD. clr. Scr my. Touch. Init. Touch my. Touch. set. PrecisionPRECMEDIUM buttons pin. Mode0, INPUT set up the ADCADCSRA PS1. Arduino library you can choose a prescaler from below. PS1. PS3. 2, PS6. PS1. ADCSRA PS6. 4 set our own prescalervoid loop while1 Draw. Betty Boop Pictures. Grid touch trigger Collect the analog data into an array. Start. Sample micros for int xpos 0 xpos lt 2. Desktop Author 4.5 Crack. Sample xpos analog. ReadA01. 02 delay. Microsecondsd. Time End. Sample micros Display the collected analog data from arrayfor int xpos 0 xpos lt 2. Erase previous displaymy. GLCD. set. Color 0, 0, 0 my. GLCD. draw. Line xpos 1, 2. Old. Sample xpos 1vsens hpos, xpos 2, 2. Old. Sample xpos 2vsens hpos if xpos 0 my. GLCD. draw. Line xpos 1, 1, xpos 1, 2. Draw the new datamy. GLCD. set. Color 2. GLCD. draw. Line xpos, 2. Sample xposvsens hpos, xpos 1, 2. Sample xpos 1vsens hpos Determine sample voltage peak to peak. Max Sample 1. 00 Min Sample 1. Old. Sample xpos Sample xpos if Sample xpos Max Max Sample xpos if Sample xpos lt Min Min Sample xpos display the sample time, delay time and trigger levelmy. GLCD. set. Back. Color 0, 0, 2. GLCD. set. Font Small. Font my. GLCD. set. Back. Color 0, 0, 2. GLCD. printDelay, 2. GLCD. print, 2. GLCD. Time, buf, 1. 0, 2. GLCD. printTrig., 2. GLCD. print, 2. GLCD. Trigger, buf, 1. GLCD. H Pos., 2. GLCD. print itoa hpos, buf, 1. GLCD. set. Back. Color 0, 0, 0 Sample. Time End. Sample Start. Sample1. 00. 0 my. GLCD. printSec., 2. Logonui.Exe Windows Xp. GLCD. print, 2. GLCD. Sample. Time, buf, 1. Range of 0 to 6. 4 7. VSample. Size Max Min. GLCD. printm. Volt, 5, 2. GLCD. print itoa Sample. Size, buf, 1. 0,5, 2. GLCD. printitoa analog.