Reading sketch from Arduino

Hello,

I've taken over a project without any documentation. I've got no access to the original code, and I'd like to avoid re-writing the whole thing. Is there a way to read the original sketch off an Uno?

I know I wouldn't get clean code, but it would be a starting point.

Thanks...

Hello,

Hillwalker:
I've taken over a project without any documentation. I've got no access to the original code...

The sort of albatross that can injure a career.

...and I'd like to avoid re-writing the whole thing.

Warm up your typing fingers...

Is there a way to read the original sketch off an Uno?

No. You can read the binary image. That can be passed through a disassembler. It will not be at all like the original sketch. To be useful, you will need to know / learn AVR assembly.

I know I wouldn't get clean code...

Correct.

...but it would be a starting point.

Doubtful.

You're not being overly helpful, CB. (But you're confirming what I suspected. :P)

The original physical construction was a nightmare. I suspect the code might be the same. Ah well, the end user is clear about what they want. I think I'll harvest the parts and rebuild.

BTW, here's what they got originally. It took me a day just to map out the relays...

http://flic.kr/p/dSRxe8 and,
http://flic.kr/p/dSRwTx

They actually paid money for this!

Hillwalker:
You're not being overly helpful, CB.

Keeping you from what most likely is a fool's errand is not helpful? :wink:

The original physical construction was a nightmare.

Is that thing in the upper-right corner supposed to be so tarnished-looking? Did it overheat? Exposed to corrosive gas?

I wonder how the 7805 in the middle was damaged. And aren't they supposed to each have two capacitors?

I think I'll harvest the parts and rebuild.

Were I in your shoes I'd take a different path. That 7805 is visibly damaged. There's no telling what the previous handler did to the various parts.

They actually paid money for this!

Bet they won't make that mistake a second time.

Is that thing in the upper-right corner supposed to be so tarnished-looking? Did it overheat? Exposed to corrosive gas?

Actually, it's the only part I'll reuse. It's a Freescale MPX5700 pressure sensor. It's encapsulated in black plastic so it looks bad in the photo. (I should re-phrase... I'll test them and if they're OK, I'll reuse them.)

I wonder how the 7805 in the middle was damaged. And aren't they supposed to each have two capacitors?

That would have been wise... The "damage" is intentional, though! As built, there was not quite enough room for the #4 bolt holding the Uno to the other side. Nothing a hacksaw wouldn't fix.

The whole project is a scrum meter for a rugby club. They want to see how various combinations of players put pressure on their opponents. They practice against padded scrum stands that have air cylinders supporting them. The MPX5700's measure the air pressure and I'll use the result to show the peak pressure, and graph the pressure over time on a Processing display.

However it turns out, I'm certain it'll be a thousand percent better than what they had.

BTW, CB, thanks for your first feedback. I was pretty sure there wasn't any way of getting any meaningful code off the original Uno's. But you never know who's got a miracle solution in their back pocket. :slight_smile:

Hillwalker:
BTW, CB, thanks for your first feedback.

You are welcome.

But you never know who's got a miracle solution in their back pocket. :slight_smile:

If the agreement did not include the phrase "work for hire" then not even a psychopathic lawyer would be able to wrest the source code from the original developer.

I think that would be pretty hard :slight_smile: