Pages: [1] 2 3   Go Down
Author Topic: The perfect debugging tool  (Read 3912 times)
0 Members and 1 Guest are viewing this topic.
nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you could have a tool or tools for debugging Arduino hardware/software what would that tool or tools be?

Just to put this in context, I'm playing with some ideas for a simple debugging tool that plugs into an Arduino, think logic-analyser-slash-protocol-analyser-slash-monitor etc. We're not talking big $ here so as much as I think a 3GHz storage scope would useful that won't be in the design.

I've already included a lot of stuff but don't want to bias any opinions so won't reveal all just yet.

And before you ask, yes it will be open source, so your ideas won't become proprietary and make me a million at your expense smiley

So, bright ideas anyone?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Sniffer for serial, i2C, SPI, onewire, ...
RAM usage monitoring ...



Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

0
Offline Offline
God Member
*****
Karma: 0
Posts: 594
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Turn the Open Bench Logic Sniffer into a shield
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ability to interpret commands to and responses from slaves.
A lot of the time, simple serial prints are all that is needed, but being able to see the hardware bits flipping is sure handy at times smiley

Think a tri-state/input mode test would be handy? Maybe pull a pin high/low with something like 0.5mA load, if it can wiggle it is not active output?
How much can a pullup resistor source?


Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Sniffer for serial, i2C, SPI, onewire,
Already done, 4x serial signals, 1xi2c and 2xSPI, all in hardware. 1-wire not done because that's a software thing, therefore it can be done later.

Quote
RAM usage monitoring ...
Very intrusive, but could be done. I know this is a common issue. The monitor could fill blank RAM then test for the pattern later, finding the bottom of the stack is easy and AVRmon already does that, I just have to find out where the top of the heap is, maybe a quick 1-byte malloc.

Quote
Turn the Open Bench Logic Sniffer into a shield
Done, the plan is to make it a shield with all connections (except some user inputs) pre-wired.

Quote
Ability to interpret commands to and responses from slaves.
My AVRmon program already does that, I plan to incorporate it into this gadget.

Quote
A lot of the time, simple serial prints are all that is needed,
Handled in a couple of ways, you won't need the Arduino's hardware UART to print data to the screen.

Quote
being able to see the hardware bits flipping is sure handy at times
Done.

Quote
a tri-state/input mode test would be handy? Maybe pull a pin high/low with something like 0.5mA load, if it can wiggle it is not active output?
Hmm, I hadn't thought of that. I'll do so now smiley

Thanks guys, it sounds like I'm on the right track so far.

______
Rob
« Last Edit: September 11, 2011, 07:01:53 pm by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's a block diagram, of course block diagrams are easy to draw smiley, getting a working circuit and code is a totally different thing.


* Untitled-1.png (28.95 KB, 719x847 - viewed 58 times.)
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
God Member
*****
Karma: 0
Posts: 594
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How about a FT2232H based JTAG debugger?
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That FT2232H does look like one sweat chip.

I already have USB, but no JTAG for two reasons. The first is that I don't know much about JTAG, the second is that most Arduinos don't have JTAG.

The Mega does though and the pins are brought out to headers.

I'm happy to collaborate on this or any other feature.

_____
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
God Member
*****
Karma: 0
Posts: 594
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

most Arduinos don't have JTAG.

oops, my bad, I assumed all AVR chips had JTAG, I guess not
I wonder if you can get DebugWIRE working somehow without official Atmel hardware
Logged

Freelance engineer, consultant, contractor. Graduated from UW in 2013.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I wonder if you can get DebugWIRE working somehow without official Atmel hardware
Now that would be nice, why it's a closed protocol I have no idea.

I suppose it could be broken but I've not heard of it being done yet, there's an opportunity for a bright young lad.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like you are only planning to support standard 168/328s with 20 IO?

324/644/1284's have JTAG too, and dual serial. I need to come up with neat project for my Bobuino.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That drawing is a little bit out of date (3-4 hours smiley), at last count I had all 20 standard IO plus another 8 "user" inputs making a total of 28 that feed directly into the analyser. I think you have 32 IO on the Bobduino so that's close. So far that's all I can pack in (at least for high-speed sampling) as I only have 32 bits and some are needed for housekeeping. I can however add extra bits for low frequency (still maybe a few MHz) checking of logic levels.

All could be displayed at human-speeds, maybe a nice graphic with LEDs for each pin. Actually, although a GUI is a way down down the track maybe having a picture of an Arduino with "logic probes" and "volt meters" you attach to pins would be a fun exercise. 

As I said, if someone knows about JTAG I'm happy to collaborate, maybe the best thing to do is just allow a convenient way to connect a standard JTAG debugger. OTOH maybe it's not that hard to implement JTAG myself, I just don't know smiley-sad

I have 4 serial inputs, by "inputs" I mean single signals, therefore that's two full serial lines, 4 half lines or any combination. These go into hardware UARTs for protocol analysis but any of the 8 user inputs can to timing as well. If an analyser is written to decode timing waveforms like the Saleae et al then you can presumably have as many as you like.

The monitor program is table-driven and can easily be made to work with the 1284.

As the Bobduino has standard headers this should plug straight in. The extra 8 IOs on that expansion header could be cabled to my user inputs.

BTW, I've added your "pin test" idea.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The four serial inputs could be 2 sets of Rx/Tx pins? Thats cool then.

The pin test, guess it could be handy.

I don't know anything about JTAG except the names of the signal lines - TDI, TDO, TMS, TCK - and what its supposed to allow you to do per some  Atmel website reading. I haven't done anything fancy enough in SW to need more then the occasional serial print tho.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The four serial inputs could be 2 sets of Rx/Tx pins?
That's right.

I'll build pin testing into the logic probe I think.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26420
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

floating test in a probe - that sounds good.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1] 2 3   Go Up
Jump to: