My Teensy Logic Analyzer

LAtimes

Well-known member
Version 3.2 of a SUMP logic analyzer for the Teensy 3.1/3.2/3.5/3.6 and LC.

It supports 8 channels up to 48 MHz, 250k samples (3.6), 24 MHz, 58k samples (3.2), 8 MHz, 4k samples (LC), with full triggering capability (trigger anywhere in the buffer).

With hardware mode, 2 channels up to 120 MHz for 3.6, 72 MHz for 3.1/3.2, 24 MHz for LC.

Pre-built releases for Windows and Linux.

https://github.com/LAtimes2/TeensyLogicAnalyzer
 
Last edited:
Following: installation.md [ on windows 10 ]

I got p#1 TeensyLogicAnalyzer code from GitHub and the sketch loaded and compiled and I have the two second heartbeat.

I extracted ◦ols-0.9.7 SP2

Copied [single file] "C:\tCode\LOGIC_SNIFF\TeensyLogicAnalyzer\LogicSniffer\ols.profile-teensy_96.cfg" to ""C:\tCode\LOGIC_SNIFF\ols-0.9.7.2\plugins\ols.profile-teensy_96.cfg""

Run.bat opens the cmd window and loads theme and then the app starts.

Got stuck as I jumped over this step in #4 : 'Set ... Analyzer port to your Teensy COM port'

NOTE: 'Show device metadata' resets the Device type to Open Bench, must be restored to Teensy.

Setup seems to work as documented! - Pressing CAPTURE

Wired LED pin 13 to pin 2 [chan 0] and [3.3v resistor to LED on GND] from resistor to pin 5 [chan 7] and nothing shows over zero? LED flickers - capture says it finished.

Nothing else to analyze now . . . but it seems a new tool in the works, Thanks
 
For step 4, if the Teensy is already running, there should be a single COM port in the pulldown for the Analyzer port. There may be a feature in the OLS that you have to set the Device type before selecting Show device metadata.

If you uncomment line 35 of the main file (#define CREATE_TEST_FREQUENCIES), you should get 25 kHz data without having to connect any signals.

Following: installation.md [ on windows 10 ]

I got p#1 TeensyLogicAnalyzer code from GitHub and the sketch loaded and compiled and I have the two second heartbeat.

I extracted ◦ols-0.9.7 SP2

Copied [single file] "C:\tCode\LOGIC_SNIFF\TeensyLogicAnalyzer\LogicSniffer\ols.profile-teensy_96.cfg" to ""C:\tCode\LOGIC_SNIFF\ols-0.9.7.2\plugins\ols.profile-teensy_96.cfg""

Run.bat opens the cmd window and loads theme and then the app starts.

Got stuck as I jumped over this step in #4 : 'Set ... Analyzer port to your Teensy COM port'

NOTE: 'Show device metadata' resets the Device type to Open Bench, must be restored to Teensy.

Setup seems to work as documented! - Pressing CAPTURE

Wired LED pin 13 to pin 2 [chan 0] and [3.3v resistor to LED on GND] from resistor to pin 5 [chan 7] and nothing shows over zero? LED flickers - capture says it finished.

Nothing else to analyze now . . . but it seems a new tool in the works, Thanks
 
For step 4, if the Teensy is already running, there should be a single COM port in the pulldown for the Analyzer port. There may be a feature in the OLS that you have to set the Device type before selecting Show device metadata.

If you uncomment line 35 of the main file (#define CREATE_TEST_FREQUENCIES), you should get 25 kHz data without having to connect any signals.

I got the COM port resolved, but three notes on one line let me miss the middle one at first time.
4.Make these settings:
Connection type to Serial port
Analyzer port to your Teensy COM port
Port Speed 115200bps (may not matter since USB)

My note was selecting Teensy - then getting metadata - results in Teensy being unselected if not noticed before leaving. It no longer does this now that I have been here before it seems to have changed the 'default' device.

I uncommented the line 35 #define - On sample not seeing anything but perhaps vertical lines on the extreme ends. With zero bars in between on all channels with T_3.1.

I wired pin 13 to 14 [chan 1] and still a flat line - even though the LED flickers during sample. That should work for you right?

I suppose you know it has a couple dozen warnings on building.
 
Sorry about these issues. I made a last minute change last night and now it doesn't record consistently. I'll get it fixed tomorrow and put out a new release.

I've glanced through the warnings and nothing of great concern. I'll get them resolved soon.
 
@LAtimes - no problem - shows great promise - just thought I'd document my walk through of your steps. Other than 'fixes needed' it should be a good tool to have. I've never used one before so have a lot to learn - and now nothing more to buy to have one. Will have to look if there is a way to have the Teensy_MTLA auto Trigger (?) to have the suspect user Teensy set a pin to initiate a capture window.

Based on seeing the LED flicker - pinning #13 to #14 would be a valid self test right?
 
Just released beta2 version that fixes these issues.

The LED flashes a lot before and after capturing data, but during the capture, the LED is on when looking for a trigger, then off after triggered. If pins 13 and 14 are tied together, channel 1 will be high for one sample at the beginning. If you set up a trigger on channel 1 going high (Mask = 2, Value = 2), channel 1 will be high before the trigger and low one sample after the trigger.

If you compile with CREATE_TEST_FREQUENCIES defined (line 35), you will see signals without having to connect or jumper any pins. Note that pins 5,6,20,21 will become outputs when using test frequencies.

@LAtimes - no problem - shows great promise - just thought I'd document my walk through of your steps. Other than 'fixes needed' it should be a good tool to have. I've never used one before so have a lot to learn - and now nothing more to buy to have one. Will have to look if there is a way to have the Teensy_MTLA auto Trigger (?) to have the suspect user Teensy set a pin to initiate a capture window.

Based on seeing the LED flicker - pinning #13 to #14 would be a valid self test right?
 
SYNC - from my GitHub fork - then copy all files from there to my 'run' directory replacing the old files

<edit>
That is how I got the source files before.

I just cleaned my run directory and did a fresh copy from GitHub and I get the same result.
 
Last edited:
I downloaded a zip file from GitHub and put it in a new directory and it compiles. Hmmm ... I'm baffled
 
Went to GitHub - Pulled the ZIP - extracted - same result . . .

Arduino: 1.6.7 (Windows 10), TD: 1.27-beta1, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz (overclock), US English"

<< REMOVED BOGUS BUILD FEEDBACK >>

^
exit status 1
could not convert 'setup' from 'sumpSetupVariableStruct' to 'sumpVariableStruct'
 
Last edited:
I'm still using 1.6.5. I made a change that might fix it - I had 2 functions called sendData with slightly different pass parameters - it looks like the compiler was using the wrong one. I deleted the old one since it's not used anymore - that may get 1.6.7 to work.

I was compiling this under IDE 1.6.7 - just opened it under 1.6.6 and it compiles there.
 
I moved sendData() to TeensyLogicAnalyzer from send_data now I get this error:
exit status 1
aggregate 'sampleSetupStruct sampleSetup' has incomplete type and cannot be defined

With that change of moving that function - I get the same error in IDE 1.6.6 ????
 
I had problems with the incomplete type issue. I may have to solve it the way I did with other projects - create a .h file with all the type definitions. It's due to the way Arduino creates forward declarations.

I'll also update to 1.6.7/1.27 to test it.
 
Compiled without even a warning - and test frequencies are evident when compiled and capture with this line active:
"#define CREATE_TEST_FREQUENCIES // if uncommented, it will output frequencies on pins 3 and 6"

TLA_b3.PNG

<edit> : Okay compiles with a note that most all RAM is in use.
 
Last edited:
LAtimes - LogicAnalyzer in forum use! Just posted in this thread: stirplate-design.

It you wanted to grab the attached sketch you can see if it gives what looks right to you. On screen time labels seemed confused between us and ms - at least I was. Do those values get calculated in OpenBench - or are they provided? Labels may be working in the end - but when I needed it most I wasn't getting the units as I was expecting at times on hover.

It helped me fix the code doing PWM output I never did before. It could show me more I'm sure. Wire from test Teensy pin #5 PWM and #13 LED. The code may not be perfect - I quite when I saw what I wanted working.

Can I get longer sample data run if I remove unused data channels? Just wondering without looking - I got what I needed tonight.
 
Glad to hear it was useful. Don't have time now to answer all your questions, but will release a new version of the logic analyzer tomorrow with advanced capability - 2 channels at 232k samples. Also up to 24 MHz at 58k samples, 8 channels.

LAtimes - LogicAnalyzer in forum use! Just posted in this thread: stirplate-design.

It you wanted to grab the attached sketch you can see if it gives what looks right to you. On screen time labels seemed confused between us and ms - at least I was. Do those values get calculated in OpenBench - or are they provided? Labels may be working in the end - but when I needed it most I wasn't getting the units as I was expecting at times on hover.

It helped me fix the code doing PWM output I never did before. It could show me more I'm sure. Wire from test Teensy pin #5 PWM and #13 LED. The code may not be perfect - I quite when I saw what I wanted working.

Can I get longer sample data run if I remove unused data channels? Just wondering without looking - I got what I needed tonight.
 
Back
Top