Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« on: January 04, 2012, 02:38:06 am » |
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.pngBut 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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 120
Posts: 10201
|
 |
« Reply #1 on: January 04, 2012, 03:04:58 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #2 on: January 04, 2012, 06:45:22 am » |
OK, I guess in this case I should install Bitlash to peek the factory setting and then set a proper OSCCAL in the sketch.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #4 on: January 05, 2012, 02:51:57 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 120
Posts: 10201
|
 |
« Reply #5 on: January 05, 2012, 02:58:34 am » |
How did you determine the OSCCAL value?
|
|
|
|
|
Logged
|
|
|
|
|
Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #6 on: January 06, 2012, 05:42:06 am » |
I didnt, just guessed.
|
|
|
|
|
Logged
|
|
|
|
|
Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #7 on: January 06, 2012, 01:17:41 pm » |
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?
|
|
|
|
« Last Edit: January 06, 2012, 01:19:54 pm by JanErik »
|
Logged
|
|
|
|
|
Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #8 on: January 10, 2012, 02:32:01 pm » |
Connected it up again to reinstall bootloader, still gives 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...?
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 120
Posts: 10201
|
 |
« Reply #9 on: January 11, 2012, 02:23:59 am » |
Connected it up again to reinstall bootloader Are you using the Arduino IDE to install the bootloader?
|
|
|
|
|
Logged
|
|
|
|
|
Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #10 on: January 11, 2012, 02:38:57 am » |
Yes.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 120
Posts: 10201
|
 |
« Reply #11 on: January 11, 2012, 03:14:26 am » |
Which board do you have selected when you try to burn the bootloader?
|
|
|
|
|
Logged
|
|
|
|
|
Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #12 on: January 11, 2012, 03:44:59 am » |
I have tried burning the "8 MHz standalone internal oscillator" bootloader, but did try the Uno too when this didnt work.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 120
Posts: 10201
|
 |
« Reply #13 on: January 11, 2012, 04:36:42 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Vasa, Finland
Offline
Newbie
Karma: 0
Posts: 21
|
 |
« Reply #14 on: January 11, 2012, 06:23:19 am » |
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?
|
|
|
|
« Last Edit: January 11, 2012, 06:26:27 am by JanErik »
|
Logged
|
|
|
|
|
|