Pages: [1]   Go Down
Author Topic: UNO + TFT Shield = Oscilloscope!  (Read 2053 times)
0 Members and 1 Guest are viewing this topic.
Worst state in America
Offline Offline
God Member
*****
Karma: 23
Posts: 665
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

0
Offline Offline
Shannon Member
****
Karma: 159
Posts: 10409
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

If you want inspiration look at the xprotolab and xminilab:
Logged

[ I won't respond to messages, use the forum please ]

Worst state in America
Offline Offline
God Member
*****
Karma: 23
Posts: 665
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Good stuff - you might need to do a little more work on it though smiley-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.
Logged

0
Offline Offline
Shannon Member
****
Karma: 159
Posts: 10409
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

[ I won't respond to messages, use the forum please ]

Worst state in America
Offline Offline
God Member
*****
Karma: 23
Posts: 665
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Germany
Offline Offline
Newbie
*
Karma: 0
Posts: 2
MIDI, DMX, CV, Gate, TimeCode ...
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

/*
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]);
  }  
}
« Last Edit: September 17, 2013, 03:39:29 pm by rolfmeurer » Logged

Pages: [1]   Go Up
Jump to: