Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 2 FirstFirst 1 2
Results 26 to 43 of 43

Thread: Teensy 3 as a osciloscope and logic analizer.

  1. #26
    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.

  2. #27
    Junior Member
    Join Date
    Nov 2013
    Posts
    1
    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!

  3. #28
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,821
    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-S...C-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/digi...1000e/ds1052e/

    http://www.rigolna.com/products/digi...1000Z/ds1074z/

  4. #29
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    DSO 2090

    China direct prices

  5. #30
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,821
    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.

  6. #31
    Check out this one:

    http://www.embeddedartists.com/produ...o/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 by mhelin; 12-12-2013 at 12:59 PM.

  7. #32
    Senior Member
    Join Date
    Jan 2013
    Location
    San Francisco Bay Area
    Posts
    641
    FYI,

    The DS1052E(50Mhz) can be flashed to behave like a DS1102E (100MHz). Same hardware apparently.
    http://www.instructables.com/id/Hack...pe-with-Linux/

  8. #33
    Junior Member scargill's Avatar
    Join Date
    Feb 2014
    Location
    Northeast of England
    Posts
    3

    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/Ardu...-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.


    Quote Originally Posted by PaulStoffregen View Post
    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).

  9. #34
    Junior Member
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by scargill View Post
    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/Ardu...-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 by mausi_mick; 10-30-2014 at 11:57 AM.

  10. #35
    Junior Member scargill's Avatar
    Join Date
    Feb 2014
    Location
    Northeast of England
    Posts
    3

    Dual Scope

    Quote Originally Posted by mausi_mick View Post
    I have made an Dual-Osci with teensy3.1 an an
    And... were you thinking of sharing code etc (he says, hopefully)...

  11. #36
    Junior Member
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by scargill View Post
    And... were you thinking of sharing code etc (he says, hopefully)...
    yes, some more pictures and the code is coming. Now I try to make a simple layout for an adapter for teensy3 with all ? (-64) pins "Dual-In-Line".

  12. #37
    Junior Member
    Join Date
    Jul 2014
    Posts
    8
    Quote Originally Posted by mausi_mick View Post
    yes, some more pictures and the code is coming. Now I try to make a simple layout for an adapter for teensy3 with all ? (-64) pins "Dual-In-Line".

    here the code:teensy30_Osci_320x240_SSD1289_08.ino
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Osci_3_2_Inch_Teensy3_1_01.JPG 
Views:	221 
Size:	153.8 KB 
ID:	2850   Click image for larger version. 

Name:	Osci_3_2_Inch_Teensy3_1_02.JPG 
Views:	211 
Size:	197.1 KB 
ID:	2851  

    Last edited by mausi_mick; 10-30-2014 at 03:57 PM.

  13. #38
    Junior Member
    Join Date
    Jul 2014
    Posts
    8
    and here the adapter for teensy3 with 5V supply:

    Click image for larger version. 

Name:	stretched_teensy3_bottom_5V_supply.JPG 
Views:	245 
Size:	50.8 KB 
ID:	2870Click image for larger version. 

Name:	stretched_teensy3_top.JPG 
Views:	321 
Size:	48.9 KB 
ID:	2871Click image for larger version. 

Name:	stretched_teensy3_top_micro_USB.JPG 
Views:	245 
Size:	36.7 KB 
ID:	2872

  14. #39
    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.

  15. #40
    I am finding I need a scope type function for troubleshooting some sensors. So I am going to try this:
    https://code.google.com/p/xoscillo/

  16. #41
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    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.

  17. #42
    That https://www.saleae.com/ is really nice. I also like the price breakout structure.

  18. #43
    Okay I am using this for displaying data from sensors hooked to my teensy:
    http://www.instructables.com/id/Ardu...-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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •