Ballston Spa, NY
Offline
Jr. Member
Karma: 0
Posts: 60
|
 |
« on: August 01, 2011, 01:45:48 pm » |
Okay, I have a project that is stationary in a totally different room than my computer is at.
I cannot just take the unit down to program it.
Is there a way I can program it with another Arduino chip?
Say "Connect Arduino 1 to Computer, program chip" >> "Bring Arduino 1 to Arduino 2, program Arduino 2"
Is it possible to do something like that?
|
|
|
|
|
Logged
|
|
|
|
|
Massachusetts, USA
Offline
Tesla Member
Karma: 98
Posts: 6389
|
 |
« Reply #1 on: August 01, 2011, 02:05:25 pm » |
It's certainly possible but I don't think anyone has implemented it yet. You would probably need an SD card or external EEPROM to store the program. You could start with the ArduinoISP sketch and divide it into two parts: the part that accepts programing from the PC and the part that sends programming to the target processor. In between you would buffer the data in a file on the SD card or on an EEPROM.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 279
Posts: 15338
Measurement changes behavior
|
 |
« Reply #2 on: August 01, 2011, 02:14:55 pm » |
Okay, I have a project that is stationary in a totally different room than my computer is at.
I cannot just take the unit down to program it.
Is there a way I can program it with another Arduino chip?
Say "Connect Arduino 1 to Computer, program chip" >> "Bring Arduino 1 to Arduino 2, program Arduino 2"
Is it possible to do something like that?
Wouldn't be easier (and much cheaper) to just download the program to the arduino #1 at the PC, then remove the 328p chip and bring it to your arduino #2 and replace the existing 328p chip in arduino #2? For around $6 you can obtain a spare 328p processor chip with bootloader so you have a spare to play around with. Lefty
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16572
Available for Design & Build services
|
 |
« Reply #3 on: August 01, 2011, 02:24:38 pm » |
How about wiring a connecter that you can access? Then walk your laptop over with a AVR ISP programmer (connects to ICSP header) and reprogram that way.
Or if is has an accessible serial port, program it thru its serial port from your laptop and normal bootloader program.
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5455
Strongly opinionated, but not official!
|
 |
« Reply #4 on: August 01, 2011, 03:15:09 pm » |
The "optiLoader" and "optiFix" sketches I've posted do this. They rely on the hex file for the target sketch being small enough to fit inside the "programming" sketch, but could be changed to read the hex from from some sort of external media instead.
|
|
|
|
|
Logged
|
|
|
|
|
Ballston Spa, NY
Offline
Jr. Member
Karma: 0
Posts: 60
|
 |
« Reply #5 on: August 01, 2011, 10:16:31 pm » |
Do you have a link I can see this at?
Also, I already have 2 Arduino chips, the biggest problem is Arduino #2 is inside a enclosure that is almost impossible to take the chip out of without causing damage to the wiring.
And I don't have a laptop... I only have a Android Phone, and unless that can upload sketches to a chip, then idk... lol
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 167
|
 |
« Reply #6 on: August 01, 2011, 11:35:03 pm » |
The "optiLoader" and "optiFix" sketches I've posted do this. They rely on the hex file for the target sketch being small enough to fit inside the "programming" sketch, but could be changed to read the hex from from some sort of external media instead.
That's basically what I'm planning to do for field updates, bootstrap with a 2nd 328 and read off an SD card for updated firmware, when the update completes hand off control of the SD card to the main chip. Or perhaps have the bootstrapping chip switch over to slave SPI mode and act as a 4k write buffer inbetween the SD card and the main chip, then at least it's not total dead weight after booting.
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5455
Strongly opinionated, but not official!
|
 |
« Reply #7 on: August 02, 2011, 01:56:45 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Ballston Spa, NY
Offline
Jr. Member
Karma: 0
Posts: 60
|
 |
« Reply #8 on: August 02, 2011, 12:10:16 pm » |
Yes, but doesn't that just install the boot-loader? I want to upload a sketch, not a boot-loader...
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 249
Posts: 16572
Available for Design & Build services
|
 |
« Reply #9 on: February 26, 2012, 04:20:42 pm » |
@westfw, Does the target chip need to be on a board/breadboard with a crystal? Or can it be 'bare' on a breadboard with just the pins connected: power, gnd, Master's D10 to Slave's Reset, D11-D11 (MOSI), D12-D12 (MISO), D13-D13 (SCK)?
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 13
|
 |
« Reply #10 on: February 26, 2012, 04:31:08 pm » |
@westfw,
I have the exact question as CrossRoads. Woult it work on a breadboard without a crystal? with the bare configuration. And one more question. Could I use my ethernet shield´s ICSP to bootload blank atmels on my Arduino Uno rev2 board?
Thanks
|
|
|
|
|
Logged
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 78
Posts: 5455
Strongly opinionated, but not official!
|
 |
« Reply #11 on: February 27, 2012, 02:11:58 am » |
It needs a crystal, since the first thing it does is set the fuses in an Arduino-compatible manner (16MHz external crystal.) (You could change this, of course. But one of the "features" is that Optiloader auto-detects the target chip type, and there isn't any way that I know of to tell the difference between a "bare chip" and a "chip with a crystal.") Adafruit has taken the code and expanded it some (programs things larger than 512 bytes, for instance.) See: http://ladyada.net/library/tools/standaloneisp.htmlAs for Arduino-Ethernet, it should work OK, but I haven't tested it, and since the ethernet circuitry is on the same SPI pins used for programming, it could have side-effects. (Do NOT try to use the rather ill-advised "power the target from IO pin 9" feature if the target is an Arduino-ethernet. It's one of those things that was just barely in-spec for nearly-bare chips, and the ethernet takes significantly more current!)
|
|
|
|
|
Logged
|
|
|
|
|
|