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.
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.
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.
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?
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...?
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.
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?
JanErik:
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.
I don't understand.
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?
That is true as long as the processor is correctly clocked. If the fuses are set for an external clock then you must provide an external clock.
But doesn't the high voltage programming reset that?
I have no idea.
Are they set for internal oscillator on a virgin chip?
Internal divided by 8 which typically results in 1 MHz.