Pages: [1]   Go Down
Author Topic: Crystal problem with 328p-pu  (Read 954 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok so I THINK that maybe I have a crystal issue but at this point im not sure of anything smiley-mad

I am trying to program a 328p-pu that I have on a breadboard with uno as isp. I can burn the bootloader no problems at all. However when I go to write the blink sketch it fails with avrdude: stk500_recv(): programmer is not responding
if I remove the reset electrolytic cap the fail is avrdude: stk500_getsync(): not in sync: resp=0x1c


Now if I pull out my 328p-pu from my uno and replace it with the one I bootloaded on my breadboard I can write sketchs no problem.

I am assuming that my breadboard is not using the correct matched caps with the crystal im using to get the correct frequency. Again I may be way off but this is my guess.


Crystal HC 49S
Frequency
16MHz
Frequency Tolerance
20ppm
Load Capacitance
20.0pF
Equivalent Resistance(Max)
60Ω
Operating Temperature Range
-20℃ to +70℃
Type
2 pin

Caps are 22pf and they are attached one lead of each to ground and the other leads one to each side of the crystal.

Im not sure if that caps are correct. I saw some formulas to figure out the correct size but I could not for the life of me understand them.

Any help would be appreciated

Thanks
Mike
Logged

Offline Offline
Full Member
***
Karma: 0
Posts: 109
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried to follow the steps from here?
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 71
Posts: 3502
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did burning the bootloader work just once, or will it work again?
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried to follow the steps from here?

No I actually was doing all of this from the arduino 1.0.1. I will try that hex file thing in avrdude and see what happens


Did burning the bootloader work just once, or will it work again?
It burns as many times as i want. It just will not take a sketch
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 71
Posts: 3502
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did burning the bootloader work just once, or will it work again?
It burns as many times as i want. It just will not take a sketch

I'd say the crystal is working then. From the factory, the internal 8MHz RC oscillator is configured as the system clock. But after burning the bootloader (which also burns the fuse bytes), the crystal oscillator provides the system clock. A valid clock is required for ICSP programming, so if the crystal wasn't oscillating, I don't think the bootloader would burn a second time. I might test that by pulling the crystal out and trying to burn the bootloader again.

The load capacitors should be more like 30pF, but I'd be a little surprised if the crystal wouldn't oscillate with the 22pF caps. See page 2 for the calculation:
http://www.foxonline.com/pdfs/xtaldesignnotes.pdf

I had some ceramic resonators with 50Ω ESR, and I saw intermittent and wildly off-frequency operation with them. Other resonators with 30Ω ESR are fine. The crystals I use also have 30Ω ESR. Pure speculation on my part, as I've looked and can't find a spec or recommendation from Atmel, but I thought perhaps the 328p's crystal oscillator doesn't like too high an ESR. So if the crystal is oscillating but is way off frequency, that could explain it, ICSP programming shouldn't be terribly frequency sensitive but uploading with the bootloader is more so.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried to follow the steps from here?


Ok so here is an update I tried this with avrdude and it programs perfectly. no problems at all. I have downloaded 3 different versions on arduino ide and all still error. What can I do to fix the IDE so it will work. Its not really practical to use avrdude all the time.
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As I understand it you have used you UNO using ArduinoISP to burn a bootloader onto a breadboard 328 and it burns without problem but when you try to upload a sketch it fails.
Is the UNO loaded with ArduinoISP still being used as the programmer for the breadboard 328 or are you using a FTDI device like https://www.sparkfun.com/products/9716 to upload sketches directly to the breadboard 328 with the burn bootloader.
If your still using the UNO as the programmer then do you just click the Upload button (right facing arrow) on the IDE toolbar (wrong way) or are you using File->Upload Using Programmer (right way). There is no need for a bootloader (it just gets overwritten anyway) if your programming the device directly like this.
« Last Edit: November 09, 2012, 09:15:47 am by Riva » Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 71
Posts: 3502
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What can I do to fix the IDE so it will work.

There is no evidence here that points conclusively to the IDE. My foremost theory ATM is that the crystal is oscillating but not close enough to spec for the async communication with the bootloader to work.

Quote
Its not really practical to use avrdude all the time.

Riva++ (no absolute requirement for a bootloader)
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If your still using the UNO as the programmer then do you just click the Upload button (right facing arrow) on the IDE toolbar (wrong way) or are you using File->Upload Using Programmer (right way).

Wow Thank you that worked!! I don't exactly understand why because when I do attiny chips (45,84) I press the upload arrow and it works. Should i always use that or just for the atmega

Thanks again smiley
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2203
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow Thank you that worked!! I don't exactly understand why because when I do attiny chips (45,84) I press the upload arrow and it works. Should i always use that or just for the atmega
I have no idea why you can program tiny chips by just pressing the upload button. I have only ever used File->Upload Using Programmer for my tiny projects.
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Pages: [1]   Go Up
Jump to: