In this part of tutorial we will see in practice how this logic analyzer works and I will give you a little tip for easier use…
For logic analyzer to work we need some kind of software on computer. I am using windows so I can’t really help users of other operating systems, but the software I am using is available for other OS’s. I am using L’Xtreme – OLS Client. It needs JAVA to run. Once you download it you need to unpack it and start run.bat. You will be presented with this window:
Now in the menu click Capture -> Begin capture and it will open new window with settings for capture:
Here are 3 tabs with settings. First thing to do is to check if there is connection to our hardware, we need to click on button Show device metadata and at the lower part of window should get something like:
Now that we know it works, let’s change some settings. Click on second tab named Acqusition. You will se this window:
This program is for some serious logic analyzer, but the things that are important and have any TODO on our hardware are:
- Sampling rate – it does work up to 20MHz, setting anything higher will still result as 20MHz
- Channel Groups – I only tested group 0, but 0 and 1 should work
- Recording size – you can leave to Automatic (Maximum)
And there are triggers. This is where things get interesting:
- You should have trigers enabled. This starts capture.
- BeforeAfter ration – with this you select how much data is collected before and how much after trigger event
- Mask – here you select which input signal triggers capture
And here is a tip for you. In your program create a small routine that just puts output pin to high and back to low. Like this…
HAL_GPIO_WritePin(TRIGGER_GPIO_Port, TRIGGER_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(TRIGGER_GPIO_Port, TRIGGER_Pin, GPIO_PIN_RESET);
…and connect this to one of the pins of logic analyzer and select that one as your only trigger. Like I have here line 4. And with this you can simply choose where in your program you want to trigger logic analyzer, because our program waits for trigger even it is a long time.
If you try to analyze your signals without this, the big chance is that the program will trigger your analyzer at startup in pininitialization.
Just for example how this thing works:
Here you can see that in the first picture the signal on Channel-0 is same through entire SPI byte transfer, this was my mistake, when I forgot to shift data that was tested for SPI transfer. And on the second picture, you can see that there is different (correct) data transfered. You can also see my trigger signal at 0,0s on Channel-4.
I hope this helped anyone.
Thank you for reading!
P.S.: If you found this helpful, I would appreciate clicking on Ad on the right side to give me a little “motivation”. 🙂