[quote author=Nick Gammon link=topic=134097.msg1009527#msg1009527 date=1353879520]
You shouldn't need a crystal, by the way.
Just as a heads-up, I think those chips are usually shipped to run off the internal 8 MHz oscillator, with the "divide clock by 8" fuse set. My programmer should work OK, I've used it with other "fresh" chips, but you might find you need to alter the fuse to get it up to full speed (once you have the bootloader on it). If you don't, it will be running at the wrong baud rate and the bootloader will appear not to be working.
[/quote]this is all i get, then hit reset
mysteredding:
i had noticed tho your tutorial doesnt incorporate completely blank(no-bootloader) bare(no-crystal) microcontrollers, have you tried it that way to see if itll work? im trying to get as much info on this as i can before i try it
mysteredding:
is that for the chip being bootloaded(blank chip)?
Yes, that's for the target chip. It only asks that for an Atmega328P. One answer gives you an 8 MHz internal oscillator bootloader, the other one gives you the 16 MHz bootloader.
Right. That indicates that you are not succesfully "talking" to the target chip. I think the wiring is the same as the Atmega328 so your wiring should exactly match the photo above.
Right. That indicates that you are not succesfully "talking" to the target chip. I think the wiring is the same as the Atmega328 so your wiring should exactly match the photo above.
[/quote]ive read your second tutorial and im guessing my 3rd party order has a pre-loaded bootloader to need a crystal, ive got some rip-outs(salvaged from old electronics) ive got a 13.#### mhz it fits onto that 4-20 range but am very limited on capacitors to use with it, are the capacitor numbers crucial to the crystal? or can i use some 47pico? and im not even sure about that number either i bought em took em out of package and forgot about em for a good while
tell you what Nick, you gave me a hell of a step in the right direction, plugging the crystal in and whatever capacitors im using(22j ceramic) which im guessing are the 22pico i needed read the chip found out yea it has a bootloader on it, im gonna try all i can to get this to work now, and thank you very much for having so much patients with me even tho my attitude was less than deserving of it, and i saw how busy you were helping everyone else, i really do appreciate everything you've done
mysteredding:
tell you what Nick, you gave me a hell of a step in the right direction, plugging the crystal in and whatever capacitors im using(22j ceramic) which im guessing are the 22pico i needed read the chip found out yea it has a bootloader on it, im gonna try all i can to get this to work now, and thank you very much for having so much patients with me even tho my attitude was less than deserving of it, and i saw how busy you were helping everyone else, i really do appreciate everything you've done
Glad to hear you are getting closer. You could take the fuse readings it would have provided and compare to the calculator here:
[quote author=Nick Gammon link=topic=134097.msg1009633#msg1009633 date=1353883801]
Glad to hear you are getting closer. You could take the fuse readings it would have provided and compare to the calculator here:
That might give a few clues. If the divide-by-8 fuse is set, then the bootloader might not work properly.
[/quote]i get this when i upload board programmer
Binary sketch size: 24,068 bytes (of a 32,256 byte maximum)
avrdude: verification error, first mismatch at byte 0x2180
0xff != 0x27
avrdude: verification error; content mismatch
and i cant find any mention of it in either tutorial
Do you have decoupling capacitors on Vcc? I had something similar a while back. You are communicating with the chip, but perhaps too fast to program it.
In my programming sketch, locate the line which says:
// slow down SPI for benefit of slower processors like the Attiny
SPI.setClockDivider (SPI_CLOCK_DIV64);
Try changing SPI_CLOCK_DIV64 to SPI_CLOCK_DIV128.
Re-upload that and see if that makes a difference.
[quote author=Nick Gammon link=topic=134097.msg1009750#msg1009750 date=1353893894]
Do you have decoupling capacitors on Vcc? I had something similar a while back. You are communicating with the chip, but perhaps too fast to program it.
In my programming sketch, locate the line which says:
// slow down SPI for benefit of slower processors like the Attiny
SPI.setClockDivider (SPI_CLOCK_DIV64);
Try changing SPI_CLOCK_DIV64 to SPI_CLOCK_DIV128.
Re-upload that and see if that makes a difference.
[/quote]i tried changing the code and re-uploading but no i didnt have decoupling capacitors attached, just put some in, and got a similar error, instead of 507 verification error(s). it had 235 verification error(s), so theres a difference but it also said the bootloader was 1024 instead of 512 like before
avrdude: verification error, first mismatch at byte 0x2180
0xff != 0x27
is my main concern, and what i think is the cause of the 500+ errors to begin with see tho it uploads just fine and works when i look at chips but doesnt wanna work with me, im gonna try using my brothers windows vista tomorrow and see if it works cuz all i need is the bootloaders changed and test programming them later, and it seems the lower i set the spi_clock the higher the error numbers go i set it to 2 and came up with 700+ errors tried setting it to 256 but is not declared so wont compile, where would i go to declare it? and will it damage the chip at all?
the days got awayfrom me and i think im gonna start from scratch but im gonna reload my OS before i do anything so i still have to wait before starting again
Hi - Having a similar problem on a Arduino Uno after about a week of use, I can't upload any new code.
avrdude: verification error, first mismatch at byte 0x0000
0x0c != 0xff
The details:
Arduino Uno
Arduino software 1.0.2
I have been reading the posts in this thread and have spent a couple of evenings on Google trying to find a solution. Have tried the simple stuff (new cable, different computer, pressing the reset during compile). I am trying to work through Nick Gammon's excellent tutorial on reburning the bootloader using a second Arduino. Have downloaded the script http://gammon.com.au/Arduino/Atmega_Board_Programmer.zip and tried to compile in the Arduino environment and I get compile errors 'atmega168_optiboot' was not declared in this scope (see attached for verbose output. Not sure where to go from here. I think that I need to compile the Atmega_Board_Programmer script before I can upload to the new Arduino board and then flash to the original board. Not sure how to get Arduino environment to do this. Is there a better way? My 20 years of experience is in mechanical engineering and the electronics world is new to me.
I compiled it without errors just then. You need to keep all the files together in the folder (don't copy the .ino somewhere else). Then the IDE will include all those .h files in the project.
This is how the IDE should look after you open the project (it's a fairly wide image):