Jump to content
43oh

Is a simple logic analyzer possible?


Recommended Posts

To all those smarter than me (that's most of you):

 

I just got my eZ430-F2013 (free! thanks gatesphere!):

http://blog.docstech.net/2010/08/24/free-ez430-f2013-usb-stick-development-board/

 

I was thinking it would be a great form factor for a simple, low resolution logic analyzer. Would the built-in UART be too slow to be of any use at all? What external parts would be necessary?

 

Just an idea that is beyond my knowledge level at the moment.

 

-Doc

Link to post
Share on other sites

I just got mine this morning too :)

 

I don't know about the speeds of the UART on that particular FET, and I haven't tested it yet, but I do intend to turn mine into a portable O'scope with logic analyzer mode (I posted a page this morning on my site about it here, and intend to do a few posts on my blog as I work on it).

 

But yes, for my purposes and assumably yours, the 9600 baud of the LaunchPad would be sufficient, and I don't imagine that the UART of the EZ430 FET is any slower than that. It's very doable.

 

Keep your blog (and this thread) updated with your progress!

 

EDIT: After some research, it seems that the EZ430-F2013 doesn't have a built-in UART. It's younger cousin, the EZ430-RF2500 does, but not the F2013. Hmm...

Link to post
Share on other sites

Darn!

 

I see the F2011 does as well: http://focus.ti.com/docs/prod/folders/print/msp430f2013.html

 

Maybe a software UART? Yes, I'm looking at you @NJC! Will your o-scope project have logic analyzer capabilities? Should it work on the F2013/F2012?

 

Sounds like the perfect project: Make a tool to help you make more projects!

 

-Doc

Link to post
Share on other sites

It's actually a question of hardware. The MSP-EZ430U that programs the board doesn't support it out of the box due to an out-of-date firmware preventing the Application UART driver from being installed, though I suspect that it could be easily flashed with the right hardware (as per this link: http://processors.wiki.ti.com/index.php ... or_Upgrade) due to the fact that mine (and I'm assuming yours too) shipped with the 6-pin, "rev 2.0" programmer. It's a shame it doesn't have it supported out of the box though.

 

Also, if the programmer were re-flashed, you would have to modify your target boards and hook up 2 pins to the Tx and Rx lines.

Link to post
Share on other sites

Okay, I get it. The MSP430F2013 on the target board can use (software) UART all we want, but the FET isn't set up to listen.

 

It looks like the link you sent is just talking about upgrading the firmware over JTAG (4/5 wires). They mention an expensive FET ($99), but they also mention the "eZ430 Rev 2 Emulator. Available on eZ430-RF2500". To me, it sounds like all you really need is some kind of JTAG interface and the Chronos firmware that they link to. I couldn't see where this will require changing the target boards at all.

 

I read someplace that there might be a way to use the LaunchPad as a USB JTAG device (possibly through those interesting test points in the corner..). Any truth to that story? If so, I might be convinced to give the upgrade a try.

 

-Doc

Link to post
Share on other sites

Yup, that's it.

 

The target board would have to be modified though because it only has a 4 pin connector, whereas the programmer has a 6 pin header. The two extra pins (which are enabled by the Chronos firmware) are the ones for the Rx and Tx lines in the JTAG specification. The F2012/F2013 target boards don't have connection points for these, you'd have to sacrifice a pin for each and wire it to either a one pin female header (do they even make them?) or a bit of wire-wrap and line them up just right.

 

The Launchpad cannot be used as a full JTAG device, as it only supports the SBW protocol. The FET on it is limited in that aspect. However, were you to populate the 6pin header J4, you could use it just like the EZ430-F2013's programmer, with UART. Basically, out of the box without significant hardware modifications, the LaunchPad is able to be used as a 'scope while the EZ430-F2013 is not.

 

However, the LaunchPad is compatible with the F20x1, F20x2, and F20x3 lines, so if someone (myself, for example) wanted to use the S/D of the 2013, They'd be able to.

 

Good thing I have 2 more LaunchPads coming. I'm turning 1 into an O'scope now. But now I have no idea what to do with my EZ430-F2013... Hmm.

Link to post
Share on other sites

Man, that was a pretty cool idea, anyway. So, the eZ430 has no communication back to the computer at all? That severely limits my ideas!

 

Good thing I have 2 more LaunchPads coming. I'm turning 1 into an O'scope now.

Wait... what?

 

It just so happens that I got three LPs in my initial order (In for a penny, in for a pound!). I would love to know how to use one as an O'scope! Can you share, or is it a work-in-progress?

 

-Doc

Link to post
Share on other sites

Well, NJC is doing a series of posts on his blog working up to one, but his involves an FTDI chip for a faster UART. Though nice, it's a bit out of my price range at the moment. I'm fine with low sample rates (i.e. the 9600baud cap on the LP), but I'm looking for high sensitivity for the analog part of it, anyway, so I'll probably end up using an F2013 in the N package on the board to use the S/D ADC. TI's Sample Program had them available a while back, so I requested a few, thinking they'd come in handy. As for the EZ430-F2013, I have no ideas what to use it for at the moment. Without UART, it's pretty useless to me. I'm sure I'll eventually have a way to re-flash the firmware, though, and then I'll have plenty of use for it.

Link to post
Share on other sites

This is why i am glad i have a serial port lol instead of an FTDI chip,

My idea for a similar project, is use an external ADC connected through SPI, and then forward the data on to the UART.

the MSP430 is just going to be used as a buffer. I am currently trying to figure out how to code ADC->DMA->Stack->USI or SPI->buffer->UART, im going to try and figure out how to use both an exteranel ADC and the internal, to create this....but my ultimate goal is going to build a BPM counter. in the end and the Logic anylizer and O-scope will be my by products of the final goal.

I will be looking forward to NJCs progress on it.

Link to post
Share on other sites

Hey everyone,

 

There's so much to reply to I will just do a giant mind dump.

 

First, a bit of a warning and some math: 9600/10 = 960 bytes per second. I dont know exactly what the minimum delay between bytes on a software UART is, but lets assume we can send 800 bytes per second. The ADC in the chip that came with the LaunchPad is 10 bits, so ignoring the lower 2 bits, we can turn this into an 8 bit oscilloscope for speed purposes. Due to Nyquists (spelling?) theorem, we can only reproduce a sine wave half the frequency of our sample frequency; in reality its more like, 1/5th to 1/10th the sample frequency. We also need an aliasing filter to keep things working correctly. Best case we will be able to see frequencies of 400Hz or less. This is very limited; but definitely usable as a *simple* oscilloscope.

 

For a logic analyzer, the speed goes up since we do not need to worry about aliasing and Nyquist; but logic analyzers are useless unless they work at much higher frequencies (in my opinion). How often are you worried about debugging digital lines that switch slower than 1khz? I guess it would be cool to still have one and useful. I just wanted to warn you all what kind of limitations would exist. Don't think I'm pooping on the project though, I think its a great project with real practical uses. Plus, as you get more advanced you can use the same exact code on a more powerful chip to increase the speed. There are two ways to implement a logic analyzer, one of which is that it measures every sample rate, and the other is that it measures changes in the signal. If you want to make it efficient it gets complicated quite fast. It is possible though to store only changes in memory, run for X number of signal changes, then send it all to the computer. That way you would be able to get a REALLY fast logic analyzer which works quite well. The hardest part would be writing software to nicely analyze your data.

 

As far as my blog goes, I will be first writing the oscilloscope project for just the LaunchPad hardware. After it is what my blog is about. The last post will be about upgrading to the FTDI chip, which I think will be nice for everyone who might want to upgrade in the future also. I might even then add the code for using it with the 5528 I have it running on.

 

I actually have the 5528 oscilloscope up and running for my own project (its more of a DAQ though) at a sample rate of 4KHz. The reason I haven't posted on my blog is because I am having huge problems with my own project. Analog circuits are tough, especially when its a stability problem. When you want to build a oscillator, it doesn't oscillate; when you want to build an amplifier, it oscillates.

 

I am almost done with the example code for the ADC, I just need to clean up the transmission (I really don't like software UARTs lol). Hope I am not taking too long, I do not want people to loose interest.

 

I am looking forward to all your own projects too! It's very exciting seeing people use the MSP430.

 

-NJC

_________________________

http://msp430launchpad.com

Link to post
Share on other sites

For the record, I've just written code to use the launchpad as a logic analyzer to reverse engineer an infrared remote control protocol. I wired the sensor to a pin set to trigger an interrupt on a low->high edge and also started a clock counting at 1MHz. The ISR stores the current TAR value in a ring buffer and flips which edge triggers the next interrupt. After initial configuration, main() enters an infinite loop waiting for data to arrive in the ring buffer; when it does, the difference between successive timestamps is emitted through the UART (I convert it to hex digits so it's readable on the PC's tty without further conversion, but this is not necessary if time is at a premium). This operation generally completes long after the signal from the remote has ceased, however there is sufficient memory to capture 50-60 bits' worth of edge timestamps. While the ring buffer is empty, main() samples TAR repeatedly; the first sample following a long period of idleness is not emitted via the UART. Interrupt latency is 5-12 cycles at 1MHz; sampling TAR should be the first thing the ISR does, to eliminate further jitter. 16 bits of timer value is enough to time 64ms at 1MHz. So it should be possible to report signals of frequency ~50Hz - ~40kHz provided the total number of pulses is sufficiently small. In practice there is enough capacitance in my circuit to smooth out the 38kHz IR carrier, so I just end up with the ~2.4kHz signal in my application; if I wanted to bandpass filter to improve range I'd have to do that in hardware.

 

Hopefully some of this will be of use.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...