Teensy 3 as a osciloscope and logic analizer.

Status
Not open for further replies.
So it sounds like the key is to use a fast ADC chip with a large fast FIFO memory chip. Then the microcontroller can get the data back out at its own speed.

I'm looking to make something like a 10 or 20MHz dual trace 'scope using a Teensy 3.0.
 
I was part of the Kickstarter for the Gabtronics Xminilab Portable. For general n00b/portable hacking it's really quite useful, and super tiny! I esp like MSO features for triggering and moderate debugging, the UART/SPI/I2C real time decoding is awesome. The arb wave form gen is really nice for playing with and testing basic analog filter circuits. While it will never replace a bench top scope, or a nice portable scope, it's really quite amazing for ~$100.

I use the Gabtronics scope mostly for checking loop/function call timing on debugging pins. It's great fun to see how code execution time changes as a fns of clock speed.

BTW, I love my Teensy 3.0!
 
For a poor man's oscilloscope, your best bet is a PC sound card with some sort of front-end to give you DC measurement and high impedance input. For example:

http://www.instructables.com/id/PC-SOUND-CARD-SCOPE-INTERFACE-FACILITATES-DC-RESTO/#step1

If you're going to spend significant money on a scope, you'd probably do much better to limp along with a sound card until you can get a real scope.

http://www.rigolna.com/products/digital-oscilloscopes/ds1000e/ds1052e/

http://www.rigolna.com/products/digital-oscilloscopes/ds1000Z/ds1074z/
 
For anyone considering a cheap USB scope like a DSO-2090, I would highly recommend you avoid it and save up for a good scope that can manage at least 20000 waveforms/sec capture with intensity-graded display.
 
Check out this one:

http://www.embeddedartists.com/products/lpcxpresso/lpclink2.php

Looks like your regular USB JTAG, here for the NXP Cortex-M4 controllers (and implemented using a LPC4370), but it is not if you plug in this board:

http://www.embeddedartists.com/products/app/labtool.php

The LabTool kit actually contains the LPC Link 2 so you don't have to buy one (but you can do so if you want to use it as a target/development board, but then you will need yet another to work as programmer...).

Specs:
11 channel logic analyzer (up to 100Msamples per second)
2 channel oscilloscope (up to 80 Msamples per second, 6MHz BW)
11 channel digital signal generator (up to 80 Msamples per second)
2 channel analog signal generator (40kHz BW)

Linux/Windows Open Source software.
 
Last edited:
Teensy CScope

I think there's a good point here - not everyone wants to spend hundreds of pounds of a scope and I've seen some Chinese ones at little over £100 who's displays are TERRIBLE.

Here's a freeby based on the Arduino...

http://www.instructables.com/id/Arduino-High-speed-Oscilloscope-with-PC-interface/

The display on the PC looks EXCELLENT but best case you are talking 227Khz operation... with a Teensy 3.1 surely you could bring that up to well over 1Mhz which is useful for monitoring some microcontroller operations... not to mention making use of the 64K buffer. I'd give it a shot but I'm sitting here with a Teensy 3.1 and I can't even figure out how to make fast register-based port control work yet (only got it yesterday)...

Pete.


I wonder if a really high performance (for a microcontroller) version of this could be built using the DMA controller in Teensy 3.0?

Of course, this only acquires digital signals. The cheapest way to do that is with the Cypress FX2 USB chip, which Saleae sells as a an 8 channel logic analyzer for $150, but lots of very cheap knock-offs are available (none of them developing or publishing any software of course... they all send you over to Saleae for the software).
 
I think there's a good point here - not everyone wants to spend hundreds of pounds of a scope and I've seen some Chinese ones at little over £100 who's displays are TERRIBLE.

Here's a freeby based on the Arduino...

http://www.instructables.com/id/Arduino-High-speed-Oscilloscope-with-PC-interface/

The display on the PC looks EXCELLENT but best case you are talking 227Khz operation... with a Teensy 3.1 surely you could bring that up to well over 1Mhz which is useful for monitoring some microcontroller operations... not to mention making use of the 64K buffer. I'd give it a shot but I'm sitting here with a Teensy 3.1 and I can't even figure out how to make fast register-based port control work yet (only got it yesterday)...

Pete.



I have made an Dual-Osci with teensy3.1 and a 4.2" touch display:

http://http://forum.pjrc.com/threads/25532-ADC-library-update-now-with-support-for-Teensy-3-1/page4

I had some problems to connect the 16 display-pins (d0..d15) with the teensy-pins (most of them on the backside).
 
Last edited:

Attachments

  • Osci_3_2_Inch_Teensy3_1_01.JPG
    Osci_3_2_Inch_Teensy3_1_01.JPG
    153.8 KB · Views: 300
  • Osci_3_2_Inch_Teensy3_1_02.JPG
    Osci_3_2_Inch_Teensy3_1_02.JPG
    197.1 KB · Views: 278
Last edited:
One thing you can consider doing is getting an old scope with a dead tube. Then you have all the conditioning electronics on the front end. You will have to strip out the tube power supply and tap into where it spits out the conditioned waveform. Then put in an LCD display and the electronics.

Also, CPLDs and GALs are good options for doing very fast timing for your ADC and memory capture of the waveform. You don't need an FPGA. Then you can suck the data out with the Teensy 3.1 and send to the USB to display. Or just use the Teensy itself. If you can figure out DMA transfer via USB it could be really fast. Not real scope fast, but pretty fast.
 
I just bought this
https://www.saleae.com/ Logic 8 product.
and I really like it.
Digital logic analyzer with SPI, UART and other decoders. Up to 50Msps.
Analog up to 10MHz bandwidth - a lot of my work doesn't need more analog bandwidth. And I have a DSO2090 (cheap) for more analog.

But this little Logic 8 (very small) is really helpful.
top notch harware quality and made in the USA.
 
Okay I am using this for displaying data from sensors hooked to my teensy:
http://www.instructables.com/id/Arduino-Improved-Poor-Mans-Oscilloscope/

The output looks like this:
http://imgur.com/NzvGy6N

I have to change the serial port in their Processing sketch to match my serial port:
Code:
//port = new Serial(this, Serial.list()[com_port], 9600);    // Com port specified here
port = new Serial(this, "COM15", 9600);    // Com port specified here

My code integration of their Arduino code is this:
Code:
int val = testSensor->ReadSensor();
Serial.write( 0xff );
Serial.write( (val >> 8) & 0xff );
Serial.write( val & 0xff );

The testSensor is a C++ object specific to my stuff. With the Processing sketch being simple of open source this could be customized to display anything you might want.

I did find I cannot send it data any faster than every 5 milli-seconds or it messes up and does not display anything. I tried higher baud rates, but I think the program is just not fast enough. So for simple scope type data visualization for semi slow data this works great. The sensors I am using are digital in nature so this is the easiest way for me to display them.
 
Status
Not open for further replies.
Back
Top