Posts Tagged: ‘logic analyzer’

Using STM32F4 as a logic analyser (SUMP/8channels/21Mhz) – (not 24Mhz)

12/20/2012 Posted by admin

or « Will my STM32F4-discovery board replace Arduino/Bus Pirate ? « …

Well I needed a logic analyzer to track some bugs in a project I am working on, but that could do more than the Bus Pirate OLS mode…

So I found this on the web : SUMP compatible logic analyzer code for Arduino.

But I also wanted a higher sampling rate.

- The code for the SUMP protocol was there from the Arduino project.
- I had the STM32F4 handy (the same I used for the MP3 – libmad port)
- The libopencm3 had a simple working example of a USB-CDC on the Discovery board

Go… Mixing everything in that code : here.
(you need libopencm3 in /opt/libopencm3)

Code update 28/04/2103 : Acquisition rate was in fact 21Mhz, there was a bug in function « cdcacm_data_rx_cb », the acquisition loop is now in an asm-inline code which should prevent different code optimization by different compiler versions. Those problems were submitted by Iosif in the comments, many thanks to him. Here is the new code.

After some tests + optimizations , here is the result : 2421Mhz sampling, 8 channels (port PE8-15).

(Lire la suite…)