Pages: [1]   Go Down
Author Topic: ATmega328p with 8MHz internal clock  (Read 764 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 96
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I trying to program the ATmega328p on a breadboard.  I know there are some bugs in Arduino 1.0 and that you could just buy a crystal and caps for under $1, but I would like to use the minimal configuration on a breadboard with Arduino 1.0.  The only components I would like to use are an ATmega328p and a reset button, and an Arduino for programming.  So this would mean no USB interface, just ArduinoISP with another UNO.  I am using a mac running OSX 10.7.3, but that shouldn't matter for any reasons.  I have seen the "Arduino to Breadboard" tutorial on the Arduino site and downloaded the zip file, but this hasn't worked.  Any help?

Thanks,
Qtechknow
Logged

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you already burned a bootloader onto the chip with specific settings to use it's 8MHz internal clock? If not, try that first.
Logged

Slovakia
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you bought that ATmega328 alone ? It's blank or it has some Bootloader in ? One way or another I believe that even if there is Bootloader on it, it will be one that requires 16 MHZ oscillator. So you need to change fuses on that chip and also burn there a corresponding Bootloader.
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 96
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the replies.  I've tried to bootload the chip for the 8MHz internal clock, and had no success with ArduinoISP or USBtinyISP.  It already has the optiboot on it, and in the boards.txt file that I have, it says somewhere that it changes the fuses.  But it also says in the boards.txt file that it uses the Arduino pro mini 8MHz bootloader.  Also I can't compile as the ATmega328p on a breadboard.
Logged

Slovakia
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I assume that Optiboot Bootloader requires 16mhz oscillator to run, what error did you get after trying to burn the Bootloader ?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8821
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino 1.0 has serial buffers that are small enough that they cause failures in the ArduinoISP sketch.  You might be able to work around that problem by setting the baud rate lower in ArduinoISP and in programmers.txt.

If you get a factory fresh ATmega 328 chip you should be able to burn an 8MHz no-crystal bootloader into it.  If you got a 328 with an Arduino bootloader on it you will need the crystal and capacitors to use a serial programmer on it (ISP won't work without a functioning processor clock).  If you have a second Ardiuno with a removable 328 processor you can use that as a temporary host system to provide the crystal clock, program your chip to use the internal clock, THEN move the chip to a breadboard.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 96
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I get the error message "avrdude: stk500_getsync(): not in sync: resp=0x66" when I try ArduinoISP, and when I try USBtinyISP, I get the error message

avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

Thanks for the replies.  Oh, and thanks John Wasser for your idea. I will get a new ATmega328p soon.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, i'm actually doing JUST what you're doing.  There is a lovely instructional on the arduino website on breadboarding an arduino in minimal mode.  It includes a txt file with the fuse settings and the other stuff that will get you a new option on your IDE to burn that appropriate bootloader.

http://arduino.cc/en/Tutorial/ArduinoToBreadboard

It will all be in the last section.  Report back with your testing as that is the last of several projects i have to do today and i ma not get it done, esp if i get a disappointing answer to my question.
Logged

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As a side-note, why not invest in an AVRisp MkII programmer next time you have a few bucks knocking around? They're hardly expensive and might make easier work of re-bootloadering things. Been meaning to get one myself for just that purpose. It's good to know all the bodges and workarounds of course, but it's also good to have a nice stash of tools smiley-grin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Why not just used the Uno board?  That is a legit question seeking and answer as that was the main reason that i didn't get a new set of dev tools. smiley.  Is it any slower to upload sketches?
Logged

South England
Offline Offline
Full Member
***
Karma: 3
Posts: 205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well EXCUSE ME  smiley-razz Maybe I'm the only one who gets tired having to hack and bodge every damn thing and actually WANTS the proper tool to hand once in a while  smiley-razz
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's BLASPHEMY!!!!
lol, i get what you're saying.  I dunno, i guess i still am at that "If i can readily build it, why buy it?" phase.I'll wisen up one day...

Qtechknow...any luck with the website i sent you?  I didn't even finish part one of what i had to do today yet smiley-razz.

« Last Edit: April 04, 2012, 06:04:27 pm by Genesisfactor » Logged

Pages: [1]   Go Up
Jump to: