Go Down

Topic: Lots of garbage on serial with 8 MHz standalone internal oscillator (Read 5563 times) previous topic - next topic

JanErik

I have set up ATMega328 standalone with the 8 MHz internal osc bootloader.
Connected it according to this and am able to upload sketches without problem, and the program also does what it should.
http://arduino.cc/en/uploads/Tutorial/ArduinoUSBSerialSimple.png

But I am getting a lot of garbage characters. Sometimes output is OK though. I have checked and redone wiring but it still does the same. Seems to be better after a reset but quickly distorts.
Could it be that the internal oscillator is not accurate enough to keep the baud rate? I am using standard 9600.
Also did another one the same way previously and it works fine.

Coding Badly

Quote
Could it be that the internal oscillator is not accurate enough to keep the baud rate?


Yes.  But the oscillator can be tuned to better than ±1% which is more than good enough for serial communications.

JanErik

OK, I guess in this case I should install Bitlash to peek the factory setting and then set a proper OSCCAL in the sketch.

Coding Badly


This will help...
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287558192

It will have to be slightly modified for the 328 processor.

JanErik

Tried to set OSCCAL in the sketch but was unable to get proper output (yet best at around 128). Not that it is very important, the project will not have communication when finished. Maybe should try to bootload the chip again.

Coding Badly



JanErik

#7
Jan 06, 2012, 07:17 pm Last Edit: Jan 06, 2012, 07:19 pm by JanErik Reason: 1
Strange, I was unable to bootload it again, althought it went fine when I dropped a new chip in place. And after trying to bootload the chip, it wont accept any sketches either, although the new one does.

Maybe there really is something broken on this? Serial works perfectly on the new chip.

Should try to bootload it again once my breadboard frees up, maybe have to use the high voltage programmer?

JanErik

Connected it up again to reinstall bootloader, still gives
Code: [Select]
avrdude: Yikes!  Invalid device signature.
Double check connections and try again, or use -F to override
this check.


Also set up the high voltage programmer ( http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/ ) but that did not help either.

How can I add "-F" to avrdude syntax, could it help?
Strange is that when I have the wrong signature with working chip (328 vs 328P) it prints out the signature but not now...?

Coding Badly

Quote
Connected it up again to reinstall bootloader


Are you using the Arduino IDE to install the bootloader?


Coding Badly


Which board do you have selected when you try to burn the bootloader?

JanErik

I have tried burning the "8 MHz standalone internal oscillator" bootloader, but did try the Uno too when this didnt work.

Coding Badly


If any part of burning the bootloader succeeded when Uno was the selected board then any further attempts at serial programming will require an external clock (crystal+caps, resonator, or clock signal on XTAL1).  I have no idea if high-voltage parallel programming will require an external clock.  I suggest getting an external clock connected before continuing.  If nothing else doing that will eliminate it as the problem.

I have a variation of the ArduinoISP sketch that provides a suitable clock signal.  If you'd like a copy send me a Personal Message.

JanErik

#14
Jan 11, 2012, 12:23 pm Last Edit: Jan 11, 2012, 12:26 pm by JanErik Reason: 1
That would be easy to check by simply putting the chip on my Uno, if I would accidentally have selected Uno when first trying to reinstall the bootloader.

But I was told that the ISP is able to burn bootloader even if the fuses are set for external oscillator... maybe it wasn't true then? But doesn't the high voltage programming reset that?
Are they set for internal oscillator on a virgin chip?

Go Up