Go Down

Topic: SUMP compatible logic analyzer code for Arduino. (Read 44 times) previous topic - next topic

caroper

#15
Jul 31, 2011, 05:45 pm Last Edit: Jul 31, 2011, 06:00 pm by caroper Reason: 1
Well I Created a header with a 100 and 10 ohm in series to bridge 5v to reset, but it appears that the Mega is still resetting.
any other Ideas?

GOT IT :)

Edit the plugins\ols.profile-agla.cfg File
line42: device.open.portdelay = 1000

The default was 500ms Delay increasing to 1second (1000ms) works fine without the 110ohm resister.


gillham

#16
Jul 31, 2011, 09:38 pm Last Edit: Jul 31, 2011, 09:45 pm by gillham Reason: 1
I was going to post this morning to let you know about that setting, but you found it on your own.  Good job!  Glad to hear that helps on your Mega.

I have not tried my code on a Mega and the timing is hand tuned to the 16Mhz ATMega328 on the regular Arduino boards.  I don't have a Mega to test it, but since it is running at the same clock rate it might be fairly close already.

Let me know how it goes for you and if you have something you can test with to see how accurate the timing is that would be useful.  If you have another Arduino with a 16MHz crystal and ATMega328, I could get you a small signal generator sketch that you could use to measure with your Mega running AGLA.

If there is enough interest from other Mega users I can pick one up and test it out.  Basically I just use some debugging to toggle an extra pin inside the capture routines and time those toggles with my Open Bench Logic Sniffer.  It is accurate up to 100MHz so I can easily measure the Arduino pins.  I highly recommend the Open Bench Logic Sniffer for anyone getting further into things than my AGLA can provide.  Of course I think the AGLA is pretty nice for "free" on your existing Arduino, but obviously has some inherent limits.

Edit:  Forgot to address your question about the Makefile.  You did the right thing using the Arduino IDE and ignoring the Makefile.  That is only for command line use if you want to skip the Arduino IDE.  Especially useful with the 'arduino-core' package under Debian.  I have compiled on my ARM based Sheeva plug computer for the Arduino using the Makefile so it can be handy.


caroper

Thanks gillham,

For the application on hand accurate timing was not needed, I just wanted to demonstrate the relative timing on a simple sequential logic experiment, but your code has captured my imagination and I would like to take it further. I switched it to using PORTC and adjusted the profile to an 8Bit sample. I saw your timing code, It occurred to me that it could be used as an external clock to run the circuit under test, but I haven't tried that yet. I would be interested to see  your signal generator sketch, but unfortunately I only have the 2 Arduino Mega boards on hand.

I have a pic32 explorer and, hopefully, some chipKit MAX32's arriving this week so once the project that they were ordered for is completed, I may dedicate one to this application.

What I have in mind is an interface to a breadboard system, such as this http://www.radioshack.com/product/index.jsp?productId=3814337.
A dual channel scope, 8 channel logic analyser, a frequency counter and a simple multimeter application running on a cheap board, possibly enclosed in the Learning Labs case, would make a great learning tool for kids of all ages. Bandwidth in the audio range for the scope and up to one Mhz for the digital portions would probably be within the capability of a high end chip.

Cheers,
Chris




gillham

I ordered an Arduino Mega 2560 from SFE, should be here later this week.  I'll work on adding better support and get the timing tuned as needed.

I like your idea of combining oscilloscope ("The cheapest dual trace scope in the galaxy" style), logic analyzer, function generator etc into a workbench toolkit that is ready to go.  It could be done just by adding a couple extra commands (similar to the debug options) or extend SUMP slightly

My current function generator code is rather simplistic and is set for my 8MHz Arduino Pro Mini.  I use 1 button and 1 LED for the UI and it works ok.  Timing is fairly accurate according to my OLS hardware, since it is using a hardware timer, but running on a 16MHz Arduino the values will be off by a factor of 2.

Anyway, I'll attach my simple function generator for anyone interested.  Make sure you use current limiting resistors as appropriate so you don't damage anything.  If you connect your target board, logic analyzer, signal generator etc, it is too easy to have pins in the wrong mode, (both output, one high, one low etc) and over current the pins on one or both devices.  1k Ohm for example on the appropriate pins will limit 5V to 5mA.

Rugged Circuits has a great page about what not to do.  ( http://ruggedcircuits.com/html/ancp01.html )

caroper

Thanks gillham, I'll give it a try.

Any Idea where I can get documentation on the SUMP protocol so I can try and integrate the analog read into the data?

Cheers
Chris

Go Up