My Teensy Logic Analyzer

Version 1.0 has been released in github:

https://github.com/LAtimes2/TeensyLogicAnalyzer

It adds Advanced configurations for 96 and 120 MHz for Teensy 3.1/3.2. This includes up to 24 MHz sample rates with 58k samples, and 475,000 samples of 1 channel at up to 2 MHz (232k samples of 2 channels, 116k samples of 4 channels). It also has the start of a User's Guide.

Next release in a few weeks will improve speeds and sample sizes for Teensy LC.
 
Thanks. Updated to 1.0, Still Working. [win10 - IDE 1.6.7 - Teensy 3.2 with 1.27b2 - LogicSniffer 0.9.7.2]

Helpful PDF to get some details. When I picked Advanced @96 the RAM default was HIGH and I had to put it down to 58KB.

<edit>: RE- one earlier comment - now that I'm looking at the display for fun rather than my trouble - I see the 'popup time stamp' is not the width of the signal - but its time in the data stream.
 
Last edited:
The reason I went with 2 different configuration files (basic, advanced) was due to the initial settings - OLS always defaults to the highest speed and sample size. Basic will work out of the box, but Advanced will usually require changing it. It also goes back to the defaults when choosing Show device metadata, so I don't use that very often and usually regret it when I do. There's some parameters in the configuration file that may help with that, but I haven't looked into that in a few years (I started this a while back and am just now making it usable for general use).

There's lots of capabilities in OLS that I haven't used much. I do use the Measurement and Cursor Details quite a bit and haven't seen any issues with them. I also just started using some of the tools like Serial Console. I tried the I2C analyzer but couldn't get it to work (I use the dual_bus_master_slave example from the I2C_T3 library on another Teensy for testing - I'll add that to the user guide soon).

<edit>: Just tried the I2C analyzer again and it worked :)
 
Last edited:
LAtimes - I found - as noted - on my virgin install the 'metadata' button reset the selected device. I only clicked it because it was featured in your docs. That may be what messed up my settings. Causes the app to hang and messes with the JAVA - closing and restarting gets errors in the next startup as well - closing and re-restarting and setting the attributes right seemed to settle it down - though I think I need to reboot as the measurement side pane faults and the position pop-up time value stopped appearing. So hitting Metadata should be a last resort when the Teensy isn't found - and then both setup tabs then need to be confirmed as right for sample speed and space.

For my first use - it provided just what I needed! Looking forward to any more details on usage. I'll try to run at 120MHz, though I only need to catch 50KHz sample changes now. Can I trade off the # channels sampled for longer sample times? That seems hardcoded.
 
Version 1.1 just released - adds Teensy LC Advanced configuration. Also a minor bug fix for Teensy 3.1 at 19.2 MHz.

Don't expect Version 1.2 tomorrow :). Maybe next weekend. Hint - faster, more samples, better timing (less jitter). Hmmm - maybe 2 weeks.
 
To anyone else with Two (or more Teensy's) online - one being this Logic Analyzer:

I tested and loaded this current TYQT 'Pre-Release' version to work perfectly well with the Arduino IDE 1.6.7 as a TeensyLoader replacement - allowing determinate selective loading from multiple IDE instances to multiple Teensy's. Per post #115 :: This version allows the 'MONITOR USB' disable so that it can UPLOAD to any connected Teensy (if not active on USB at that time - for instance doing a capture) - but no longer permanently attach to selected Teensy USB devices to allow other programs to function with them as needed - like the Teensy Logic Analyzer project where CAPTURE data comes to that program over USB - but yet you can monitor the Subject Teensy being analyzed or others over one or more instances of TYQT Serial Monitor!

BTW - in the OpenBench I tried to use its Serial Monitor and it was a fail. It was somehow overwhelmed and faulted and also seemed to go single thread blocking Capture of more samples? Maybe my JAVA engine was messed up? TYQT is a non-Java app (Open Bench and Arduino IDE are both JAVA) - more stable and dedicated and offers awesome GUI support for Monitor - Reset - Upload of any attached Teensy. And now that the Monitor can be selectively disabled and hooked to the IDE for code Upload it is the perfect tool to use with this Logic Analyzer. Especially since on my Win10 machine the IDE 1.6.7 SerMon is often a failure at catching the debug spew from the device under test - TYQT fills a big hole.
 
I'll have to load TYQT. I've been disconnecting and re-connecting as I switch between the Logic Analyzer and the Test board.

BTW - in the OpenBench I tried to use its Serial Monitor and it was a fail. It was somehow overwhelmed and faulted and also seemed to go single thread blocking Capture of more samples? Maybe my JAVA engine was messed up? TYQT is a non-Java app (Open Bench and Arduino IDE are both JAVA) - more stable and dedicated and offers awesome GUI support for Monitor - Reset - Upload of any attached Teensy. And now that the Monitor can be selectively disabled and hooked to the IDE for code Upload it is the perfect tool to use with this Logic Analyzer. Especially since on my Win10 machine the IDE 1.6.7 SerMon is often a failure at catching the debug spew from the device under test - TYQT fills a big hole.

The logic analyzer requires dedicated use of the USB serial port. I use the hardware serial port on the logic analyzer board for debugging (see DEBUG_SERIAL macro in the code), and have a USB to serial program running on another Teensy connected to the serial monitor in OpenBench.
 
@LAtimes: Hope it helps - TYQT is exactly what this calls for - Koromix just did a schedule swap to get the Monitor to drop and let this work - thought maybe you had another good solution. I haven't found anything so specifically perfect - especially with the way IDE SerMon has been failing me.

For TYQT: Download it to a directory and run the EXE. It locates Teensy units generically until it watches them boot. If you do the HELP / Arduino integrate it will help you as noted to upload to the RIGHT unit direct from the IDE after it asks you to associate them - no more button pushing.

For the Analyzer you just hit the MONITOR icon on that Teensy to take it offline - and it won't tie up the USB, allowing Capture.

You could use TYQT for the third Teensy pulling its serial to USB to simplify the load on Open Bench. <I saw that debug code in there> Ctrl+N opens multiple windows of TYQT so each Teensy can have it's own window as needed.

After Capture you could even have TYQT enable 'monitor' to the port and have the Analyzer Teensy DUMP any session info or anything you want. I was just using TYQT at 1MB/s from USB so it can generally handle full speed dumping.
 
Logic Analyzer Version 2.0 is released. Adds Hardware mode that uses 2 SPI channels to go up to 24 MHz. Teensy LC benefits most from this, but 3.x also gets up to 30 MHz with full triggering. See first post for the link to the github repository.
 
Logic Analyzer Version 3.0 just released. It adds complex triggering with up to 4 stages. This allows edge triggering or looking for multiple pulses (e.g. 2nd, 3rd, or 4th SPI/I2C transfer). Also, for 3.1/3.2, increased 2-channel hardware mode up to 72 MHz sample rate (sorry LC, still 'only' 24 MHz).

https://github.com/LAtimes2/TeensyLogicAnalyzer
 
Last edited:
Version 3.2 release has full support for Teensy 3.5 and 3.6. Teensy 3.6 can go up to 120 MHz, 2 million samples for a single channel.

That is great new LAtimes! I saw this work on the T_3.2, but the limited RAM made the sample period small.

If the DMA is free - It seems using FranksB's DMA updated ILI9341 using half of RAM could make a nice SCOPE screen for (near) REAL TIME usage!
 
I'm not sure what I did, but I followed the instructions as given on the Github Page.

  1. Downloaded and ran Windows - OLS .zip , unzip, and run run.bat
  2. Selected Capture -> Begin Capture, and set Analyzer port to COM port (COM6)
  3. Selected Device type for your Teensy type, then select Load Firmware (240MHzTeensy 3.6 Demo)

It seemed to run once in with capture in OLS mode, but when I ran it a second time (in OLS-DEMO mode) I got the following error from Windows:
"USB DEVICE NOT RECOGNIZED - The last USB device you connected to this computer malfunctioned, and Windows does not recognize it."

Now I can't get it to recover even using Defragster's recovery method.

Notes:
  • Windows 10, Arduino 1.6.11 Teensyduino 1.30-b4, Teensy 3.6-r3
  • Nothing but an encoder was hooked up to the Teensy 3.6 at the time, other than the serial cable.
  • TyQT does not see the Teensy 3.6
  • I am still able to program a Teensy 3.0 with no problem
  • Reset pin pulls low when program button is pressed then goes high again.
  • Plugged it into a Windows 7 PC (that's never seen it before) and there is no response by Teensyduino or Windows 7
  • - Tried a T3.0 in that machine that it had never seen, and it loaded driver and compiled normally.
  • Plugin with Program button depressed gives the Windows 10 "USB DEVICE NOT RECOGNIZED" error
  • Teensyduino in verbose mode doesn't show any response to the Teensy 3.6
  • Created a new Arduino 1.6.11 installation With Teensyduino 1.30-final, but that did not help.

It looks like it's dead Jim. I recommend not trying this Logic Analyzer on your Teensy 3.6 until this problem is resolved.
  • EDIT: Both Paul and LAtimes have run the Hex file successfully on Teensy 3.6, so my problem may be unrelated to Teensy_Logic_Analyser. (see post #48)
The OLS application Flashes the Teensy directly, I wonder if it overwrote the magic byte, or mangled the USB Identification?
 
Last edited:
It seemed to run once in with capture in OLS mode, but when I ran it a second time (in OLS-DEMO mode) I got the following error from Windows:
"USB DEVICE NOT RECOGNIZED - The last USB device you connected to this computer malfunctioned, and Windows does not recognize it."

Now I can't get it to recover even using Defragster's recovery method.

I am using the initial beta 3.6. I was getting this off and on while testing, but I had 2 Teensies connected. When I disconnected both and just connected the 3.6, it always came back.

If you are running TyQT at the same time, make sure the serial port is turned off (Serial -> Enable Serial).
 
I am using the initial beta 3.6. I was getting this off and on while testing, but I had 2 Teensies connected. When I disconnected both and just connected the 3.6, it always came back.

If you are running TyQT at the same time, make sure the serial port is turned off (Serial -> Enable Serial).

LAtimes,
I've tried multiple reboots on two different PC with different cables.
Nothing else is connected to the PC USB
Teensyduino, TyQT or Windows alone do not respond, other than the "USB DEVICE NOT RECOGNIZED" warning.
However I test immediately after with the Teensy 3.0 and get a normal response

Plugging it in normally to the USB has no Windows 10 response whatsoever.
Plugging it in to the USB with the Program Button depressed is when I get the "USB DEVICE NOT RECOGNIZED" warning.

I tried the OLS application again, But it does not see the Teensy 3.6 anymore.

If you have any clues, I'd be grateful.
Thanks,
--Wozzy
 
I've been trying to think what it could be. If the logic analyzer code is running, the LED should blink every 2 seconds. It is running overclocked at 240 MHz, which worked fine on my sample of 1 :). Have you run any programs at 240 MHz on yours previously?

I used Teensyduino 1.30-beta3 to compile. It uses tyc (command line TyQt v0.7.6) to load the firmware.
 
I've been mostly using 240 MHz and haven't experienced any problems with it.

I also tried pressing the reload about a hundred times hoping it would catch one time and load blink, but alas that was not successful.

I'm going to try a fresh install of Arduino 1.6.11 with Teensyduino 1.30-final, but I don't expect it will make a difference.

Thanks for looking into this for me.
 
I've been trying to think what it could be. If the logic analyzer code is running, the LED should blink every 2 seconds. It is running overclocked at 240 MHz, which worked fine on my sample of 1 :). Have you run any programs at 240 MHz on yours previously?

I used Teensyduino 1.30-beta3 to compile. It uses tyc (command line TyQt v0.7.6) to load the firmware.

I've been using the builds Koromix updated for me on the v0.7.5 tree? Perhaps he has been making the edit on both trees but when I look at FILES on the 0.7.6 tree is a month since last update and not a week?
koromix/ty/ty#files/
 
I've been using the builds Koromix updated for me on the v0.7.5 tree? Perhaps he has been making the edit on both trees but when I look at FILES on the 0.7.6 tree is a month since last update and not a week?
koromix/ty/ty#files/

It is using the latest Bintray build - 0.7.5-204-g33f592f.

One other thought on Wozzy's board - in Demo mode, the logic analyzer sets pins 3, 5, 6, 20, and 21 to outputs. If they were connected, it could cause problems. But I doubt it would kill the entire board. I need to highlight that in the instructions.
 
in Demo mode, the logic analyzer sets pins 3, 5, 6, 20, and 21 to outputs. If they were connected, it could cause problems.

At the time of the malfunction I had a rotary encoder with push switch hooked up.
The encoder was wired to pins 3 & 4 like this:
rotary-encoder-arduino-wiring.png

VCC was 3.3V supplied by the Teensy.
The switch was wired to pin 2 similarly.
I did not rotate the encoder, or activate the momentary contact switch.

It seems like WMXZ had a similar problem (LINK) with his T3.6 under completely different conditions, So this may be unrelated to Teensy_Logic_Analyser
 
Last edited:
I've been trying to think what it could be. If the logic analyzer code is running, the LED should blink every 2 seconds. It is running overclocked at 240 MHz, which worked fine on my sample of 1 :). Have you run any programs at 240 MHz on yours previously?

LAtimes,

Yes, until this event I've been using my T3.6 mostly at 240 MHz without any problems.
The LED was not blinking.

Yesterday I sent my T3.6 back to PJRC for analysis.
Paul is investigating the issue with my T3.6.
He was able to load the the same 240MHz_Teensy3.6_DEMO Hex file on a different T3.6 without problems, so it's likely that the issue is unique to my system.
 
Last edited:
Update on this ... Paul released an updated T_3.6 bootloader to Version 1.03 for the native uploader processor on the Teensy and the behavior seen has been corrected - here is the clipped version of that reply::

1.03 automatically detects this condition and automatically recovers, so with 1.03 you would never have been in this unusable state where you'd try holding the button for 15 seconds. I tested the automatic detection and recovery on your board, by flashing the MLK02 chip without disturbing the K66 chip. Version 1.03 did indeed restore your board automatically.

But if for some reason the problem happened in a way where the automatic detection didn't work, yes, the 15 second button press would initiate the mass erase which recovers.

Your board is fully restored and updated to 1.03. I shipped it back last night ...
 
Just an update.
I sent back my T3.6 beta to PJRC.
Paul confirmed that my problem was the same as WMXZ's T3.6 and had nothing to do with Teensy_Logic_Analyzer.
Most likely something interrupted the hex file upload, or I inadvertently pressed the Program button before the process was complete.
Paul developed a new version of the Teensy Loader program (Teensy.exe Version 1.31) that uploads a new bootloader Version 1.03 to the T3.6's MKL02.
This update would have prevented the problem from occuring on My T3.6.

Additionally it adds a new feature:
If you hold the program button for 15 seconds (actually, between 13 to 17 seconds) the chip is fully erased, including eeprom data
This would have allowed me to recover my T3.6 from the stuck condition that it was in.
But I only had V1.02 bootloader on my T3.6 beta so I was unable to recover it.

Paul was able to hack my T3.6 to upgrade the bootloader from V1.02 to V1.03, then recover it.
Robin sent it back to me and I now have my T3.6 beta in hand and fully operational.
[GLOWING PRAISE] PJRC IS AWESOME!! [/GLOWING PRAISE]

I'll try the Teensy_Logic_Analyzer again when I receive my 2 T3.6 Kickstarter rewards and report back here.
 
Last edited:
Back
Top