Pages: [1] 2   Go Down
Author Topic: AtMega328 with Internal 8MHz Oscillator Questions  (Read 11878 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used this guide to burn the bootloader for the use of an ATmega328 with the internal 8MHz oscillator. http://arduino.cc/en/Tutorial/ArduinoToBreadboard
It burned without a problem and then I hooked it up to program the chip. I took the chip I had in my arduino and connected up the TX and RX. When I tried to program the board with my code, I got the
stk500_getsync():not in sync:resp=0x00
stk500_disable():protocol error, expect=0x14, resp=0x51
errors. I have the correct board selected and the right com port

Also, the prototype of my device is set up to use a 16MHz external oscillator since I'm having trouble getting the internal one to work. If I do get the 8MHz clock working, would I need to disconnect the external 16MHz clock? or could I leave it connected and the atmega would just know to use the internal resonator?

Any info will help! Thank you!
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have the correct board selected and the right com port
Did you install an 8 MHz bootloader?

Quote
If I do get the 8MHz clock working, would I need to disconnect the external 16MHz clock?
I didn't need to.

Quote
or could I leave it connected and the atmega would just know to use the internal resonator?
That worked for me.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I added the 8MHz board folder to my hardware folder, uploaded the Arduino ISP to my arduino board, selected the 8MHz atmega328 as the board, selected burn bootloader>ArduinoISP. It went through without error. I disconnected everything and just hooked up the minimal circuit to program the chip with my code, and it just hangs and gives me that error.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
hooked up the minimal circuit to program the chip with my code
An FTDI adapter?

Have you ever used AVRDUDE from the command-line?
« Last Edit: November 22, 2010, 05:12:17 pm by bcook » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have never used AVRDUDE from command line. The minimal circuit is in the link I shared in my first post. Basically power the chip, hook up the TX and RX lines from my arduino, take the chip out of my arduino so it only talks to the one on the breadboard (that theoretically has the internal oscillator set) and is powered by the arduino.
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Some of the fuse settings are questionable (like disabling the brown-out detector) but they are certainly correct for an internal 8 MHz processor clock.

I have no idea what could be wrong.  As far as I can tell, you're doing everything you should be.

Can you connect an LED + resistor to pin 13?  I believe the bootloader will blink the LED while it waits for a connection.  Yoiu'd at least know if the bootloader is trying.
« Last Edit: November 22, 2010, 08:11:21 pm by bcook » Logged

Denver
Offline Offline
God Member
*****
Karma: 20
Posts: 779
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm having exactly the same problem as  Dandeman321 . . .
- the lilypad 328 bootloader burns fine
- the led on pin 13 is flashing as normal after burning the bootloader
- afterwards, I can't load a sketch to the chip
   stk500_getsync():not in sync:resp=0x00
   stk500_disable():protocol error, expect=0x14, resp=0x51
   (using the same board setting as when burning the bootloader)

It's strange. I've done this several times in the past, and I even tried it on  IDE Rel 17 which worked for me then. (using Rel. 21 now)

If I re-burn the bootloader back to 16MHz I can load programs again.

I'm stuck!  :'(  If anyone has a suggestion, I'd appreciate it.
« Last Edit: January 04, 2011, 12:50:23 pm by BroHogan » Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If I re-burn the bootloader back to 16MHz I can load programs again.
Just to make certain I understand...

When running at 16 MHz, you're using a crystal?

The processor is a 328?

You're using the Arduino IDE to burn the Lilypad bootloader?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Everything right except for the bootloader. It's a special one that was released from arduino. In the initial link I posted, you can find it.
Logged

Denver
Offline Offline
God Member
*****
Karma: 20
Posts: 779
Inactive - PM
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Coding Badly, thanks

Quote
When running at 16 MHz, you're using a crystal?
Yes, the crystal is also connected when trying to run at 8MHz. I didn't think it mattered, but maybe it does after all? (Something to try)

Quote
The processor is a 328?
You're using the Arduino IDE to burn the Lilypad bootloader?
Yes to both. The Lilypad 328 bootloader.

BTW, I did try the the new "ATmega328 on a breadboard (8 MHz internal clock)" (but only once), and I got errors while loading that bootloader. However, I should try it again to be sure.
« Last Edit: January 04, 2011, 02:42:30 pm by BroHogan » Logged

"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@Dandeman321:

Did you get the processor + bootloader to work running from the internal oscillator?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


I don't know why I didn't think of this earliear but the problem could simply be that the processor needs to be tuned.  If either of you would like, I will prepare a test to determine if that is the problem.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tuned? At this point, the project I was working on has been taken over by another individual. You don't have to bother with setting up a test. Thanks for the offer though!
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 200
Posts: 12782
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Tuned?
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1287558192
Logged

Pages: [1] 2   Go Up
Jump to: