Replace the file in
“/hardware/arduino/bootloaders/optiboot/optiboot_atmega328.hex” with the
downloaded file.
Select “Tools > Board > Arduino UNO”.
Select “Tools > Burn Bootloader > w/ USBTiny”
Wait for bootloader to be uploaded.
Is that correct?
If so I will try that when I get home.
No, that's incorrect. Look, if you follow the instructions:I have not mentioned 'upload bootloader' anywhere. Bootloader was only used on OpenSprinkler v1.0/1.1 which do not have a built-in USBtiny programmer and had to rely on an external serial programmer.Now I understand the problem: when you burned a bootloader, it must have changed the fuse bits to use external crystal. But OpenSprinkler v1.4s is supposed to run on its internal clock, so there is no external crystal installed on the board. As a result, the microcontroller cannot start because there is no crystal. This is a common issue with avr microcontrollers, that is, if you happen to change the fuse bits the wrong way, you will end up bricking the microcontroller.But you don't need to panic, the clock issue is easy to solve. All you need is to connect a crystal of 8MHz (or 16Mhz, or any frequency that's at least 4MHz) to the crystal pin pads, and run the following command to change the fuse bits back:avrdude -c usbtiny -p m328p -B 250 -F -U lfuse:w:0xe2:m -U hfuse:w:0xd1:m -U efuse:w:0x06:mOnce the fuse bits are set, you can remove the crystal and the mcu should run on its internal clock.On the 1.4s, the crystal pin pads are located on the left of atmega328 and marked X1. There are three pins. You can either get a ceramic oscillator, which has 3 pins that match it, or a 2-pin crystal, in which case you connect the two pins to the first and third pad, leaving the middle pad unconnected. If you don't have any ceramic oscillator or crystal, shoot me an email and I am happy to send you one at a small cost.
On Tuesday, October 9, 2012 9:00:04 PM UTC-4, got1 wrote:
C:\Documents and Settings\user>avrdude -c usbtiny -p m328p -B 250 -F -U lfuse:w:xe2:m -U hfuse:w:0xd1:m -U efuse:w:0x06:m
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude done. Thank you.
<install crystal>
C:\Documents and Settings\user>avrdude -c usbtiny -p m328p -B 250 -F -U lfuse:w:xe2:m -U hfuse:w:0xd1:m -U efuse:w:0x06:m
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.05s
avrdude: Device signature = 0x1e9514
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude: reading input file "0xe2"
avrdude: writing lfuse (1 bytes):
Writing | ################################################## | 100% 0.03s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xe2:
avrdude: load data lfuse data from input file 0xe2:
avrdude: input file 0xe2 contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xd1"
avrdude: writing hfuse (1 bytes):
Writing | ################################################## | 100% 0.05s
avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xd1:
avrdude: load data hfuse data from input file 0xd1:
avrdude: input file 0xd1 contains 1 bytes
avrdude: reading on-chip hfuse data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0x06"
avrdude: writing efuse (1 bytes):
Writing | ################################################## | 100% 0.03s
avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x06:
avrdude: load data efuse data from input file 0x06:
avrdude: input file 0x06 contains 1 bytes
avrdude: reading on-chip efuse data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
C:\Documents and Settings\user>avrdude -c usbtiny -p m328p -F -U flash:w:firmware
1.8.1.hex
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.03s
avrdude: Device signature = 0x1e9514
avrdude: Expected signature for ATMEGA328P is 1E 95 0F
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "firmware1.8.1.hex"
avrdude: input file firmware1.8.1.hex auto detected as Intel Hex
avrdude: writing flash (32652 bytes):
Writing | ################################################## | 100% 7.36s
avrdude: 32652 bytes of flash written
avrdude: verifying flash memory against firmware1.8.1.hex:
avrdude: load data flash data from input file firmware1.8.1.hex:
avrdude: input file firmware1.8.1.hex auto detected as Intel Hex
avrdude: input file firmware1.8.1.hex contains 32652 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 5.25s
avrdude: verifying ...
avrdude: 32652 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.
I am confused, do you mean that the uP can be programmed to use
the EXTERNAL ceramic oscillator?
If so, is there any reason to NOT use the external clock?
Is the external ceramic oscillator substantially more accurate than
the internal clock?
If the fuses are set once, will avrdude still work, or will avrdude need to
reset the fuses each time it is used to flash the uP?
What arguments do we give avrdude to set the fuses for EXTERNAL clock?
Thanks for your help.
On Friday, October 12, 2012 6:54:48 AM UTC-7, Ray wrote:
> It does, but the fuse bits can be programmed to use internal clock.
>
> On Thursday, October 11, 2012 2:06:29 PM UTC-4, garygid wrote:Does the uP on the 1.4u also run on the internal clock?I am confused, do you mean that the uP can be programmed to use
the EXTERNAL ceramic oscillator?
If so, is there any reason to NOT use the external clock?
Is the external ceramic oscillator substantially more accurate than
the internal clock?
If the fuses are set once, will avrdude still work, or will avrdude need to
reset the fuses each time it is used to flash the uP?
What arguments do we give avrdude to set the fuses for EXTERNAL clock?
Thanks for your help.