UNO + TFT Shield = Oscilloscope!

This is nothing yet... just a quick test to see how fast is is. I do a simple loop from 0 to 319 and send an analog input (scaled to 0...239 with map()) to Tft.setPixel() and it works!

(click for video)

Good stuff - you might need to do a little more work on it though :wink:

If you want inspiration look at the xprotolab and xminilab: - YouTube

MarkT:
Good stuff - you might need to do a little more work on it though :wink:

I just tossed it together to see if it would work and upon seeing the sine wave I laughed just because it was SO COOL!

In reality, it's not fast enough to be a "real" oscilloscope (and it would never beat my HP DSO), but it was neat anyway.

Cool - but cooler with a trigger input? Add a pot to one analog input to set the trigger level - not that much more work?

MarkT:
Cool - but cooler with a trigger input? Add a pot to one analog input to set the trigger level - not that much more work?

You're tempting me! I may just go ahead and make a full blown scope out of it!

I'll have to add it to my list of projects "to do".

The big one I'm working on now is for a research project at the university here (my employer). I used to use Motorola 68HC11 EVBU boards for student projects, but the Arduino is SO much easier to program (C vs raw assembler) and the 328P has a lot more memory than the HC11 (the HC11 only has 512 bytes of SRAM and 512 bytes of EEPROM and no flash at all!).

For every project I had to build daughterboards ("shields" in Arduino-speak) for I/O, memory, D/A, etc... now all of that is built into the chip - which costs less and is easier to program.

Code that would have taken me weeks to do in ASM I've done in only a few days with the Arduino. Wish I knew about these a lot sooner!

-- Roger

/*
simple basic oscilloscope by Rolf Meurer
to get both half-waves on screen we must shift the DC ground to half the Arduino operation voltage.
this can be done by using 2 resistors in series (e.g. 2 x 1k) where one resistor goes to VSS and the other resistor goes to VCC.
Now connect the inputsignal HOT potential to A15 and Cold to the center, where both resistos are bend together.
*/

#include <UTFT.h>

// Uncomment the next line for Arduino Uno
//UTFT myGLCD(ITDB32S,19,18,17,16); // Remember to change the model parameter to suit your display module!

// Uncomment the next line for Arduino Mega
UTFT myGLCD(ITDB32S,38,39,40,41); // Remember to change the model parameter to suit your display module!

int sample[321];
void setup() {
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setColor(255, 255, 255);
}

void loop() {
for (int i = 1; i < 320; i++){
sample = analogRead(A15);

  • }*
  • myGLCD.clrScr();*
  • for (int i = 1; i < 319; i++){*
    _ myGLCD.drawLine (i, 120-sample*,i+1, 120-sample[i+1]);_
    _
    } _
    _
    }*_