Hi dc42.
I am getting similar issues as this with a 328p-au..
I've tried alsorts but am a bit stuck:
http://arduino.cc/forum/index.php/topic,129740.0.html
Any ideas?
Thanks in advance.
Looking at your post #7 in that thread, you are setting the baud rate to 300 on the mcu but then you have to set the PC to 2400 to communicate with it. So the UART in the mcu is running 8x faster than it should be. This isn't a problem with the CLKSEL fuse bit, that would cause the mcu to run 8x slower instead.
Are you sure that you have F_CPU set correctly in the boards.txt file you are using? Do you also find that delay and delayMicroseconds calls also execute 8x faster than they should?
Thanks for getting back to me Don.
From using the calculator I managed to get the baud correct with:
lfuse:w:0x77:m
(I know this is probably incorrect).
..and from messing about trying to set the fuses again I am back to the same issue of the baud reading out incorrectly and chasing my tail..
The board.txt is set to:
--------------------------------------------------------------------------------------
##############################################################
uno.name=Arduino Uno
uno.upload.protocol=arduino
uno.upload.maximum_size=32256
uno.upload.speed=115200
uno.bootloader.low_fuses=0xff
uno.bootloader.high_fuses=0xde
uno.bootloader.extended_fuses=0x05
uno.bootloader.path=optiboot
uno.bootloader.file=optiboot_atmega328.hex
uno.bootloader.unlock_bits=0x3F
uno.bootloader.lock_bits=0x0F
uno.build.mcu=atmega328p
uno.build.f_cpu=16000000L
uno.build.core=arduino
uno.build.variant=standard
--------------------------------------------------------------------------------------
The following worked when I had the baud reading at the correct rate:
- IDE does not upload
- AVRDude upload via Arduino ISP works
- Upload in IDE via Arduino ISP works
- Serial feedback (TX-RX loop) works [328 bypassed]
- Serial feedback via 328P works
- Holding reset at various times before/during/on upload no dice
- f_cpu=16000000L
I've double checked all my schematics, including the pull down 1k, 100nf cap between the 8u2 and the reset on the 328P-AU.
I have also removed and resoldered these components.
Could this be an issue with the 8u2?
I have managed to run the DFU many times with the same code I uploaded on to my R3 and this still uploads and works.
Thanks in advance for any suggestions!