Pages: [1]   Go Down
Author Topic: Downloading a sketch to breadboard 328 using Arduino as ISP (Resolved)  (Read 1224 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 56
Posts: 2187
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have: Windows 7-64, IDE 1.03, Arduino UNO
I have successfully used the ArduinoISP sketch to burn bootloaders on 328PUs on a breadboard.
I have tried to download sketches using ArduinoISP several times using the 10uf method from reset to 0V, with no success.

I have had some success downloading sketches using ArduinoISP using the following process:
In Boards.txt, I copied the original "uno section", modified it as seen below and changed the baud rate to 19200
Code:
##############################################################

uno1.name=Arduino Uno Breadboard
uno1.upload.protocol=arduino
uno1.upload.maximum_size=32256
uno1.upload.speed=19200
uno1.bootloader.low_fuses=0xff
uno1.bootloader.high_fuses=0xde
uno1.bootloader.extended_fuses=0x05
uno1.bootloader.path=optiboot
uno1.bootloader.file=optiboot_atmega328.hex
uno1.bootloader.unlock_bits=0x3F
uno1.bootloader.lock_bits=0x0F
uno1.build.mcu=atmega328p
uno1.build.f_cpu=16000000L
uno1.build.core=arduino
uno1.build.variant=standard

##############################################################
Note: the original line was "uno.upload.speed= 115200"
Process:
1. Restart the IDE and upload the ISP sketch to the Arduino
2. Select, Tools/Board/Arduino Uno Breadboard
3. Load the "Blink" sketch  or "other sketch"
4. Upload the "Blink" sketch
5. The bootloader does not respond since its baud rate is 115200 and the Board baud rate is 19200
6. The ISP sketch takes over and "Blink" is written to the 328PU on the breadboard.
7. The Blink sketch 328PU works OK.

The problem: if I try to load a new sketch to the breadboard 328PU I get this error:
Quote
avrdude: verification error, first mismatch at byte 0x010a
         0x6a != 0x60
avrdude: verification error; content mismatch
My work around this is to re-burn the Bootloader to the breadboard 328PU and then do 3-7 above.

Would someone please explain the problem and suggest a solution to this situation?
« Last Edit: January 18, 2013, 09:08:56 pm by LarryD » Logged

UK
Offline Offline
God Member
*****
Karma: 17
Posts: 568
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just to clarify, is your breadboard a 328-PU or a 328P-PU?

Burning a bootloader to a 328-PU requires modifying avrdude.conf to provide a M328 entry with correct signature, and a 328 entry in boards.txt pointing at the correct avrdude model and bootloader.

Once you've done that you can't actually upload to the board via Arduino as ISP (or serial) with the board type selected as 328. You have to upload set as the original 328P Arduino UNO.

When Uploading via Programmer, with Arduino as ISP selected as programmer, Onto a bread boarded uC I have never used any additional capacitors. I just take a jumper from Pin 10 on the Arduino to the Reset pin on the breadboarded uC. The reset on the breadboarded uC is pulled high normally with a 10k resistor. I believe you only need that 10uF cap on the target IF it's another Uno, not a bare uC.

You then connect 11 > 11, 12 > 12 and 13 >13

Make sure your board is now set as the Target board and hit Upload via Programmer OR hold Shift while you hit the Upload button.

I'm not sure what you are doing with the whole changing of baudrate thing as that is not required at all. It almost sounds like you are trying to disable the ISP board bootloader and then upload with the normal Upload option, rather than Upload via Programmer.

If your going to program via ISP then the bootloader was only burnt to set all the fuses up correctly. As soon as you do your first upload via ISP to the target uC the bootloader on that device will be overwritten.
Logged

Offline Offline
Edison Member
*
Karma: 56
Posts: 2187
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Just to clarify, is your breadboard a 328-PU or a 328P-PU?
The breadboard controller is a ATMEGA328P-PU
Quote
Make sure your board is now set as the Target board and hit Upload via Programmer OR hold Shift while you hit the Upload button.
I completely missed this.
No need to change Boards.txt
I won't forget this one.

Everything works great!
Just to summarize, my breadboard has a 328P-PU has 22pF caps. a 16MHZ crystal, 10 to reset,11 > 11, 12 > 12 and 13 >13
heartbeat/error/program LEDS on pins 9/8/7.
T h a n k   Y o u !
 
Logged

Pages: [1]   Go Up
Jump to: