20 Mhz ATMega 328

For the discussion of Arduino related topics.

Moderator: phalanx

20 Mhz ATMega 328

Postby sting » Wed Feb 08, 2012 2:44 pm

I bought a pair of the AVR 28 Pin 20MHz 32K 6A/D - ATMega328 processors, not really paying attention to the fact that they were 20Mhz, more is better, right? Well, once I realized they are not supported arduino processors, I have been attempting to use them with 16MHZ crystals. I thought this should work, and I could use an arduino in Arduino as ISP. I have checked the voltage on the processor and that seems correct.

All I can get is the message: avrdude: stk500_getsync(): not in sync: resp=0x00 and no diagnostic.

I have tried with 16MHz crystal and with a 16MHz ceramic resonator and I always get the same result.

Is there a way to find out what is going wrong?

Or am I wasting my time and should just go and buy the 16MHz processor?
sting
 
Posts: 26
Joined: Tue Jan 19, 2010 8:58 am

Re: 20 Mhz ATMega 328

Postby trialex » Wed Feb 08, 2012 8:16 pm

Or am I wasting my time and should just go and buy the 16MHz processor?


It's the same processor - the 20MHz is just the MAX speed.

I think you need to give a bit more info on what you are doing and/or what's not working. Have you burned the (correct) arduino bootloader onto the chips that you bought?
trialex
 
Posts: 279
Joined: Tue Jan 09, 2007 3:55 pm

Re: 20 Mhz ATMega 328

Postby stevech » Wed Feb 08, 2012 8:35 pm

sting wrote:I bought a pair of the AVR 28 Pin 20MHz 32K 6A/D -

Or am I wasting my time and should just go and buy the 16MHz processor?
The Arduino bootloader code assumes a certain crystal or resonator frequency is in use. If the one on the board differs, you'll see the error.
The issue is not the speed of the microprocessor, but rather its the compatibility of the crystal frequency. The 20MHz chip can operate with any crystal/resonator up to 20MHz; likewise the 16MHz chip.

So you can either change the crystal to match what the installed bootloader expects, or vice-versa, change the bootloader. For the latter, you'll need someone with an "ISP" programmer to recompile the bootloader and "flash" it into the chip. Or perhaps you can find on line an Arduino bootloader for your combination.
stevech
Support Volunteer
 
Posts: 2805
Joined: Sat Jun 05, 2004 8:51 pm
Location: USA, California

Re: 20 Mhz ATMega 328

Postby sting » Wed Feb 08, 2012 9:45 pm

stevech wrote: you can either change the crystal to match what the installed bootloader expects

the process does not have a bootloader, I am trying to upload it.

I have this exact setup on my breadboard.
Image

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

I have followed the instructions. I thought the processor should be ale to work, but it doesn't. I am looking for a way to get a feeling for what isn't working right.
sting
 
Posts: 26
Joined: Tue Jan 19, 2010 8:58 am

Re: 20 Mhz ATMega 328

Postby Philba » Thu Feb 09, 2012 12:03 am

what arduino model are you using?
Philba
Support Volunteer
 
Posts: 2503
Joined: Sun Feb 13, 2005 11:33 pm
Location: Seattle

Re: 20 Mhz ATMega 328

Postby sting » Thu Feb 09, 2012 12:30 am

Arduino Duemilanove
sting
 
Posts: 26
Joined: Tue Jan 19, 2010 8:58 am

Re: 20 Mhz ATMega 328

Postby kf2qd » Wed Feb 15, 2012 2:28 pm

Try 120 Ohms from Reset to +5V on your Arduino Board.

Also - which version of the ArduinoIDE did you use to load the ArduinoISP Sketch? Use Arduino-0.22 as 1.0 has an issue at 19200.

Also - you may need to use AVRDude from the command line as as the command string to AVRDude needs a slight modification. Once they have the bootloader they can be used in the arduino board without a problem. I would hook up a 16MHZ crystal for programming and initial testing.
kf2qd
 
Posts: 4
Joined: Wed Feb 15, 2012 2:08 pm

Re: 20 Mhz ATMega 328

Postby Xykon » Thu Feb 23, 2012 5:31 pm

Hello,

I think I'm in the same boat as you are as I also bought some 328 without the P at the end. I changed the signature in avrdude for the 328P so now it accepts talking to the chip. I have it breadboarded as well and I'm trying with 8MHz,16MHz and 20MHz crystals.

When I try to burn the bootloaders ATmegaBOOT_168_atmega328.hex or ATmegaBOOT_168_atmega328_pro_8MHz.hex (with 20/16/8MHz crystal) I get verification erros while reading.

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x7a00 0xc0 != 0x80
avrdude: verification error; content mismatch


The optiboot bootloader seems to install OK but I can't get a serial connection to the chip after that (same error as original poster).

The strangest part is that at one point I got the ATmegaBOOT_168_atmega328.hex bootloader to program without error and I could even run the basic blink example but then I suddenly lost the serial connection and I'm back to the same behavior as before.

I tried to find out what the difference is between the 328 and the 328P but couldn't find anything. Does anyone have an idea what might be different between the two chips? Since I only bought three of them the loss isn't that big but I'd have to make another 80€+ order at mouser to get free delivery again...
Xykon
 
Posts: 3
Joined: Wed Dec 07, 2011 10:56 pm

Re: 20 Mhz ATMega 328

Postby Xykon » Fri Feb 24, 2012 9:14 am

Well I got a bit further last night... Instead of using Sparkfun's AVR pocket programmer I used the SF Buspirate and the chip programmed OK with the ATmegaBOOT_168_atmega328.hex bootloader and I got serial access to the chip.
However as soon as I upload a sketch the bootloader seems to get overwritten... it might be simply a difference of where the bootloader is placed in flash memory between the two chips. I haven't used arduino before (I've been using GHI's .net modules mostly) but I think it's "only" a matter of fuses and lockbits which have to be set differently on these two chips. Maybe the normal 328 places the bootloader at the start of the flash chip and the 328P puts it at the end and that's why it gets overwrittent once I upload something via serial cable... In that case I guess I have to "reverse" the lfuse and hfuse and maybe also the lockbit?

I'm wondering if anyone else has haver been working on this... since there doesn't seem to be any "official" support for the 328 in avrdude and also the compiler doesn't work unless I pretend it's the 328P.
Xykon
 
Posts: 3
Joined: Wed Dec 07, 2011 10:56 pm


Return to Arduino

Who is online

Users browsing this forum: No registered users and 3 guests