Go Down

Topic: AtMega328 with Internal 8MHz Oscillator Questions (Read 14552 times) previous topic - next topic

Dandeman321

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!

Coding Badly

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.

Dandeman321

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.

Coding Badly

#3
Nov 22, 2010, 11:11 pm Last Edit: Nov 22, 2010, 11:12 pm by bcook Reason: 1
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?

Dandeman321

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.

Coding Badly

#5
Nov 23, 2010, 02:09 am Last Edit: Nov 23, 2010, 02:11 am by bcook Reason: 1

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.

bHogan

#6
Jan 04, 2011, 06:48 pm Last Edit: Jan 04, 2011, 06:50 pm by BroHogan Reason: 1
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.
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Coding Badly

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?

Dandeman321

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.

bHogan

#9
Jan 04, 2011, 08:39 pm Last Edit: Jan 04, 2011, 08:42 pm by BroHogan Reason: 1
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.
"Data is not information, information is not knowledge, knowledge is not understanding, understanding is not wisdom."
~ Clifford Stoll

Coding Badly

@Dandeman321:

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


Coding Badly


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.

Dandeman321

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!

Coding Badly

Quote
Tuned?

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

Go Up