Jump to content
Sign in to follow this  
robomon

Designing a Logic analyser using GPIO <-> DMA <-> USB

Recommended Posts

Hi,

 

I am planning to build a logic analyser using my Tiva-C launchpad. I have seen a logic analyser using the SUMP protocol but it uses  the USB CDC (serail port) to transfer data.

http://www.fischl.de...aris_launchpad/

 

I need a better sampling rate for my GPIO. My plan is to copy the contents of GPIO data register using DMA into the USB FIFO. Then use some custome device driver in USB to transfer data to PC instead of using USB CDC class drivers.There is a similar example for STM32(but for a different application)

http://www.st.com/st.../CD00256689.pdf

 

How to find out the sampling rate for a GPIO ?

If I use DMA to copy the data from GPIO, will the performance(i.e sampling rate) of the logic analyser increase ?

Could anyone let me know how fast DMA can copy data from GPIO and write to USB FIFO ?

How fast can USB CDC then transfer data to the PC ? Do I have to implement USB "BULK" mode(or some custom driver) to transfer data?

 

I found that Saleae logic analyser uses this same concept(copy data from GPIO directly to USB) http://www.saleae.com/logic

There is a open source driver for this device to understand the implementation http://sigrok.org/wiki/Fx2lafw

 

Is it worth to design a logic analyser using GPIO <-> DMA <-> USB concept if there wont be much improvement in the performance since there already exist one based on the SUMP protocol(the first link that I have shared).

 

Thanks!

Share this post


Link to post
Share on other sites

Hi,

First some technical details about your sources of inspiration:
1) FX2L chip which is the base of Saleae product is an 8051 chip, with some heavy-duty hardware embedded - their GPIF stands for General Purpose InterFace - which has not a correspondent in TM4C123 chips. Also there is an high-speed USB interface, designed to run at maximum, 480M. Also the chip has a big 4K FIFO buffer.
2) So the corresponding sigrok software can be used only as a template, since it is specifically written for 8051. The hardware implementation also dictates the software, so you must be prepared to  hard work to cover/replace/adapt all these to the hardware of Cortex-M4 implemented by TI.
 
Now, about the concept TM4C123: GPIO >> DMA:
GPIO as it is implemented  has irregular timing responses, due to on-chip bus arbitration and delays across bus bridges. Sampling rate cannot be specified - usually to realize sampling, you use a timer, but this will introduce delays due to interrupts. At most, you can use a continuous loop read of a port, but that also will depend on software. DMA is only triggered at pin events, which is not what you need.
 
But there are some good news: TM4C129 series has a module (EPI) similar to GPIF in FX2L chip - and the use of DMA is a good thing. Configuring the EPI in general purpose mode could be a good solution. The maximum sampling rate is 60MHz and is a predictable operation, which is a big advantage over usual GPIO. Remember, you need to make uniform sampling of signal and this must be done all the time, not only at edge changing. The sampling clock (EPI clock) can be easily configured for various EPI baud rates.
 
On more word: Saleae implementation does not use any triggered acquisition, which limits the usefulness of such tool (my opinion, since I need that, your may differ…)
 
But all these depend on your goals - for a demo or proof of concept you may try anything… but I will vote for EPI.
 
Regards,

Share this post


Link to post
Share on other sites
How to find out the sampling rate for a GPIO ?

If I use DMA to copy the data from GPIO, will the performance(i.e sampling rate) of the logic analyser increase ?

Could anyone let me know how fast DMA can copy data from GPIO and write to USB FIFO ?

How fast can USB CDC then transfer data to the PC ? Do I have to implement USB "BULK" mode(or some custom driver) to transfer data?

 

Don't have any Tiva experience, but done something simple based on MSP430F5xx...

http://forum.43oh.com/topic/3909-msp430f550x-based-logic-analyzer

 

I used DMA PIO > RAM transfer (MCLK/2 rate), and after collecting samples, they are transfered to PC over USB.

 

DMA on Tiva will work when address buss is free, but you can check what is going on if during collecting samples address buss is for sure free (not used for enything else). If there will be any randomly events or changing of sampling rate.

 

USB can go till 1 MB/s and some benchamarks (for MSP430F5xx) are here...

http://forum.43oh.com/topic/2775-msp430-usb-benchmark

 

Doubt that Tiva can go over this (even with custom driver).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×