Go Down

Topic: The perfect debugging tool (Read 4560 times) previous topic - next topic

Graynomad

#15
Sep 12, 2011, 01:05 pm Last Edit: Sep 12, 2011, 01:07 pm by Graynomad Reason: 1
Attached is the current ideas document (including up to date block diagram), I think I've covered what's been mentioned.

I've actually done an initial PCB placement and most of the schematic design for the front end, just need to hook it all up to the controlling micro (a non-trivial task, any LPC ARM experts out there?).

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

robtillaart

Never worked with an LPC ARM but happy to do some code review
Rob Tillaart

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

robtillaart


Will it be the MBED processor ?  Its is on my ToLearn list

- http://ics.nxp.com/support/development.hardware/mbed.lpc176x/ -

IDE over the web (co-editing?)
Rob Tillaart

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

CrossRoads

"Oscilloscope
• 6-channels connected to Arduino analogue pins
• 12-bit sampling up to 400kHz (1ch) less for multiple channels"

Is that fast enough to look at something like I2C and determine that smaller pullup resistors are needed?
Just an example as that's one of the last things I had happened to look at.

Logic analyzer - will that use the system's 8 or 16 MHz clock as the sampling rate clock? Or an independent source from the LPC ARM?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Graynomad

#19
Sep 13, 2011, 02:25 am Last Edit: Sep 13, 2011, 06:04 am by Graynomad Reason: 1
Quote
Never worked with an LPC ARM but happy to do some code review

Thanks, I haven't either but it just seemed like the right chip and it's something I've wanted to use for a while now.

Quote
Will it be the MBED processor ?

No, I just can't get my head around that IDE over the web thing, having to be connected to do development just doesn't make sense to me. The Mbed uses a 1768 which is very similar to the 178x I plan to use, so close in fact that I thought I would use the Mbed to prototype code, but then there's that "IDE over the web thing" and as far as I can see there's no provision for doing it any other way.

However if you want to get into them and also want to contribute to this I see no reason code can't be easily ported to/from the Mbed and the 178x.

I might get a couple of LPC Xpresso dev boards. They are only $30 and you get the free IDE (a real IDE based on Eclipse). I've already downloaded the IDE and played with some sample code, it works great.

Quote
Is that fast enough to look at something like I2C and determine that smaller pullup resistors are needed?

Hmm, generally I'd say no as the 400kHz sample rate is the same as the typical i2c bit rate and with analogue sampling you typically want to sample at about 10x the frequency of the data you are sampling.

However, doing this might work as you really aren't interested in the waveform per se, just whether or not the signal is being pulled low enough. So if the samples were taken at the right moment the viewed waveform would probably look like some form of triangle wave but the highs and lows should be the voltage on the line at that time.

So the short answer is that it should work in a fashion.

The 400kHz is the max rate the chip can read, so there's not much to be done about that without an external ADC feeding into the digital channels.

Quote
Logic analyzer - will that use the system's 8 or 16 MHz clock as the sampling rate clock? Or an independent source from the LPC ARM?

Currently I plan for the sampling to be run with an internal clock (timing mode), as to how fast I don't know yet but 20-40MHz should be doable (all I can work on is the data sheet at present, I have no experience with these chips). It may also be possible to use an external clock (state mode), I'll look into it.

_____
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Graynomad

#20
Sep 13, 2011, 05:00 am Last Edit: Sep 13, 2011, 06:06 am by Graynomad Reason: 1
Quick update.

I've done a lot of micro design work over the years but man working with a 208-pin chip is a whole new world of hurt. Not that it's really any more complex, in fact these chips are simpler than 8-bitters in many ways. It's just the shear number of pins to deal with.

As I couldn't find a schematic model I had to define my own, that took about half a day to enter the names and numbers for all 208 pins then recheck and cross check. What a job, did I mention that there is 208 pins?

Luckily I found a footprint and 3D model, so that was easy.

I have done most of the front end design as I mentioned before so then came the task of matching the functions I want to the actual pins on the processor. On a 328 or some such that's pretty easy but on these chips just about every function can be muxed to 3 or 4 pins. Having those options is good and bad, good because options are always good right. Bad because now I have to decide which of the optional pins to use for every function, some are mutually exclusive and some not muxable.

For example ADC3 shares a pin with the DAC, and these are special analogue pins that don't have other options. I need the DAC so I've had to drop an analogue input, fortunately I still have 7 left. Also I need the entire PORT 2 free for reading the LA inputs, luckily there is only one pin on P2 that has a another function that can't be muxed to another pin, as that's the "force an ISP boot on reset" pin it's not a problem and can be handled externally.

I also want to leave about 50 pins free in case I go the external memory option and these XM pins are not muxable.

As there's no way I can hold all these options in my head I've knocked up a spread sheet with pins and functions organized in various ways on different pages. This took another few hours of entering and cross checking data from 3 different directions. Did I mention that there is 208 pins?

So I have now finally done most of my pin allocation but these may still change when doing the PC layout for real.

Just in case someone is interested I've attached a couple of pics. The PCB is just a first placement attempt, I haven't run traces to the MOAC (Mother of all chips) yet and haven't decided on the external RAM option. The schematic is the front end logic as it stands right now.

As always, should you decide to comment please do. This post will self destruct in 30 seconds.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

WanaGo

Quote from: Graynomad

Did I mention that there is 208 pins?

Haha - just adds to the fun doesn't it?

Man you are progressing fast, I hadn't looked at the post for a day or so.

Did I mention that I want one !?

Quote from: Graynomad

This post will self destruct in 30 seconds.

Did I make it, did I make it???

I know a guy in the US just attempting to use one of those 32bit Atmels with 3xx pins, in one of those packages with the pins underneath (brain has stopped on me...) - is that the next challenge?

How many layers is your PCB so far? are you going with 4 on this one?

Great work :)
James

Graynomad

Quote
one of those packages with the pins underneath

Probably a BGA (Ball Grid Array).

Quote
is that the next challenge?

Not likely.

Quote
How many layers is your PCB so far? are you going with 4 on this one?

I really want to stay with 2 layers. I know everyone says it's no more expensive to go 4 but with the people I use it's double the price. What I don't know is if these chips need any special ground planing. I don't see why they would as all the fast stuff is internal but getting a really solid ground into the power pins may be an issue.

Maybe I should look into using a different fab house.

Quote
Did I mention that I want one !?

You're on top of the list, but I hope you don't need it next week :)

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Looking good. What is used to make the 3D drawing?

Some questions:

How does power get connected? Does it get all from the USB?
USB (& interface chip?) connector missing from the schematic?
Crystal, decoupling still to be added?
Can you add more ground pins with the SPIs, UARTs, other single pin things, so twisted pair contacts, coax, etc. can be used to make connections off board?
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Graynomad

Quote
What is used to make the 3D drawing?

I use Altium, all that's included. I get most models from here

http://www.3dcontentcentral.com/

If they don't have what I need I make one in Altium, it's pretty primitive for that but with practice you can make a reasonable model.

Quote
How does power get connected? Does it get all from the USB?

I think I'll go 100% power from the USB, I hate wires and that's one less. Open to suggestions re barrel jacks etc though.

Quote
USB (& interface chip?) connector missing from the schematic?
Crystal, decoupling still to be added?

Yep, that's just the "front end" page, there's a second page that will have that stuff on it.

Re USB, there is no interface chip, the LPC comes with a full interface including PHY so in theory all you need are a couple of resistors and some ESD protection. I've downloaded the USB code but let's just say I'm not 100% certain I will get it to work as I've not done any low-level USB stuff before. (I'd really like someone who has to step in for this :))

SO, plan B.

The LPC has an inbuilt bootloader, pull a certain pin low on reset and it will connect to UART0 and run a monitor/boot loader. I will program using ISP but I need to implement this serial port anyway for in-field upgrades so my plan B is to use an FTDI cable on this port. In which case it will work more or less the same as an Arduino, programming and talking on the same serial port. This will only be a pain for developers though because users don't program the processor.

Quote
Can you add more ground pins with the SPIs, UARTs, other single pin things, so twisted pair contacts, coax, etc. can be used to make connections off board?
Will do.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Graynomad

New feature.

I'm trying to avoid feature creep and I've baulked at having the Quadd do much control because of the extra hardware required for multiplexing signals. But I just had a clever idea so it looks like I'll add some features to control the target Arduino hardware.

Still thinking but I should be able to turn around the buffers and have the Quad actually emulate the Arduino processor. This would be good for testing peripheral chips with no need for Arduino code.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Graynomad

I got an offline question along the lines of "that looks good, but what does it do?" and it reminded me that such a device is for a certain audience. If you've just bought you first Arduino and are trying to get the LED to blink you do not need something like this.

If you're experienced you probably do but you also probably have a lot of tools already. Still maybe this will consolidate them while providing a few extras. Either way it has to be easier than connecting 15 wires from 3 different tools.

If you're somewhere in the middle and you're happy with serial.print()s and staring at the chip wondering what it's thinking then it's not for you either.

But for intermediate to advanced developers who are not happy with chip staring I think this could be a good tool.

The following is an expanded version of my response email.

Quote
The Quadd plugs onto the Arduino headers, in general it does not "use" any pins and can coexist with any other shield. Your Arduino is totally separate in the sense that your current Arduino interface and programming method doesn't change, however if the Quadd is configured appropriately you can easily view what your program is doing rather than staring at the chip and scratching your head.

As an example I though I'd try to illustrate a typical scenario, getting your Arduino working with another chip over ISP, let's say the other chip is an IO port expander.

Firstly, after uploading your code you can view the SPI registers (with the inbuilt AVRmon program) on the Arduino to ensure they are correctly set. If not you can change them in situ without having to do a compile and upload.

You can do a timing analysis on the SPI signals to see if the bits are wiggling as expected, then when the fundamentals are working and you want to look at the data flow between chips you do a protocol analysis to see the traffic of bytes on the MISO and MOSI signals.

The only real difference between the two is that timing shows waveforms and state shows data, however with a suitably-written GUI the two display styles would merge to a large degree.

If things seem to be working but not quite, let's say you get data from the IO expander but your serial.print() is reporting the wrong value, you can trigger on an IO expander input changing state and see what data was sent. If it is correct on the SPI lines then the Arduino code has a problem, of not then there's an issue with the IO expander.

Another option is to let the Quadd take over the SPI lines. In this case you can disconnect the Arduino's processor (the Quadd does this by holding the chip in a reset state so no need to do anything physical) and manually (or using pre-canned data) read and write the chip.


Accessing Arduino program debugging data

You don't need to use serial.print() and open/close a serial monitor all the time. There will be a few ways for the Quadd to read data from the Arduino's program.

•   Newsoftserial. Pick any spare pin and transmit data, will work but overkill if all you want is some debug output.
•   Debug serial. A very simple and small transmit-only serial function.
•   Shiftout. Use the standard library function.
•   SPI. Use the hardware SPI port.
•   IPC RAM. If you don't have a single spare pin the Arduino and the Quadd can agree on the location of a section of RAM (IPC, Inter Processor Communications) and both can read/write from/to this RAM. So if you organise your code to use this RAM for some variables then you don't have to do anything on the target, the AVRmon monitor program will extract the values and display them. The RAM is simply an array in the Arduino memory.

Whichever method is used the data can be displayed in a permanently-open watch window.


______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Graynomad

Another idea.

Sorry guys I just can't stop myself despite my previous comments on feature creep.

As it stands the Quadd should work with any Arduino (or clone) that has standard headers, including the Mega. But what about the Fio/Nano/Pro/Pro mini and other "breadboard friendly" clones. Or even the Lilypad, the shape doesn't matter.

If the Quadd had a general-purpose interface shield all these features would work with the smaller boards.

______
Rob 
Rob Gray aka the GRAYnomad www.robgray.com

frank26080115


but then there's that "IDE over the web thing" and as far as I can see there's no provision for doing it any other way.


That's very wrong, I'd hate to see somebody avoid mbed because they are simply misinformed, the mbed is way better than the Arduino in every way

just grab arm-elf-gcc and the other stuff in the toolchain, and grab CMSIS from NXP (the equivalent of the Arduino "core" files), compile via makefile, drag-n-drop .bin file onto mbed

the online compiler is amazing, by the way, you can write a library or code, share it (documentation generation is automatic if you use comments), keep track of revisions, talk about it, import other people's libraries/program with a click, all in one place. The absolutely only downside is that it's online, but that makes sense, since most of the features are online, plus they have a sweet deal with ARM so they can let you use their super-optimized compiler for a low cost
Freelance engineer, consultant, contractor. Graduated from UW in 2013.

Graynomad

Thanks for the heads up on that.

Quote
I'd hate to see somebody avoid mbed because they are simply misinformed

Then Mbed have a serious publicity problem. The "fact" that it needs to be used online is AFIAK the general perception and I just spent half an hour trawling Mbed.org and cannot find a single mention of anything about offline compiling. It may be there but I couldn't find it.

Frankly that should on a great big banner on the home page because it does look like a fantastic board but some of us here in the third world can't be online all the time :)

Quote
just grab arm-elf-gcc and the other stuff in the toolchain

I already have the LPC express environment running, can I use that or get the tools from that install?

Are there any tutes on how to do this with example makefiles?

Do you have to drag and drop?

Can the makefile upload?

As I mentioned before I plan to use the 178x which is the big brother of the Mbed processor but as far as I can tell almost the same so code should port easily from one to the other. So getting an Mbed is a very attractive option, even if just as a prototyping tool to start with.

Quote
the mbed is way better than the Arduino in every way

It does look good from the technical aspect, how about the community? Is it as good as this one? It doesn't look as extensive but I haven't browsed the forum yet to get a feel for the helpfulness of the people there.

______
Rob


Rob Gray aka the GRAYnomad www.robgray.com

Go Up