atmega328P not accepting anything

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
philipm
 
Posts: 29
Joined: Tue Dec 27, 2011 10:50 am

Re: atmega328P not accepting anything

Post by philipm »

Cool. For future reference, you should try to make the paths to the crystal/resonator shorter. Longer paths increase capacitance which can cause issues. You could also try the circuit without the crystal/resonator and just use the internal clock (since for this project you don't need anything like 16Mhz!), will save you a few milliamps too. You can leave the PCB as is, just don't solder it on and change the target when burning the bootloader.

smkoberg
 
Posts: 55
Joined: Tue Aug 11, 2009 3:45 am

Re: atmega328P not accepting anything

Post by smkoberg »

Alright, here I am with two final questions, hopefully.

First; if I do decide to go the route of leaving out the resonator, what would I change the target to?

Second; for the final project, I want to have the LED's hanging below the PCB so I can hang them in a mason jar/paper lantern. What is the smallest gauge wire I can use that will work for this? I found a website a few days ago, and I can't remember/find it now, but it said that 28 gauge wire will allow enough current to illuminate the LED's.

User avatar
john444
 
Posts: 443
Joined: Sun Mar 04, 2012 2:42 pm

Re: atmega328P not accepting anything

Post by john444 »

Hi SmokoBerg,

The low strength and availability of small wire sizes may be more of a problem than the wire's resistance.
For example,
30-awg wire has about 0.1-ohm / ft.
40-awg magnet wire is slightly more than 1-ohm / ft.

So, if you plan on going 10's of feet with 40-awg wire,
just allow for the wire resistance (both ways) by reducing the current-limiting resistor's value.

BTW, 30-awg Wire-wrap wire is surprisingly strong, easy to work with and readily available.
With a hand wrapping tool, you can strip and wrap wires on LED pins quickly. Don't even need to solder.
I would recommend it for connecting your LEDs.
Good Luck, John

philipm
 
Posts: 29
Joined: Tue Dec 27, 2011 10:50 am

Re: atmega328P not accepting anything

Post by philipm »

If you leave out the resonator, use the target:
"ATmega328 on a breadboard (8 MHz internal clock)"

In fact you can try it on your current test board without disconnecting the resonator. It will just ignore it and use the internal clock. So if it works without drama, you can be confident with the final design. ;)

smkoberg
 
Posts: 55
Joined: Tue Aug 11, 2009 3:45 am

Re: atmega328P not accepting anything

Post by smkoberg »

john444 wrote:BTW, 30-awg Wire-wrap wire is surprisingly strong, easy to work with and readily available.
If you think 30-AWG wire would work, then I'm sure 28-AWG wire would work too. I'm not using through hole LED's, so my plan was to strip the coating off a few mm's of the wire and solder to the pads on a 1206 SMT LED. Also, I'm not planning on running wires any longer than 1 foot, so I think the resistance shouldn't be too much of an issue.
philipm wrote:If you leave out the resonator, use the target:
"ATmega328 on a breadboard (8 MHz internal clock)"
I pulled up my Arduino IDE to check and that isn't listed as an option in the boards menu. All I have are different flavors of Arduino.

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: atmega328P not accepting anything

Post by mtbf0 »

smkoberg wrote:
philipm wrote:If you leave out the resonator, use the target:
"ATmega328 on a breadboard (8 MHz internal clock)"
I pulled up my Arduino IDE to check and that isn't listed as an option in the boards menu. All I have are different flavors of Arduino.
try the lilypad target.

philipm
 
Posts: 29
Joined: Tue Dec 27, 2011 10:50 am

Re: atmega328P not accepting anything

Post by philipm »

The lilypad has a resonator on it, so doesn't use the internal oscillator. The fuse settings need to be different to enable the internal oscillator. (Do please correct me if I am wrong!)

Add the following to your boards.txt file and you'll get the new target...

Code: Select all

##############################################################

atmega328bb.name=ATmega328 on a breadboard (8 MHz internal clock)

atmega328bb.upload.protocol=stk500
atmega328bb.upload.maximum_size=30720
atmega328bb.upload.speed=57600

atmega328bb.bootloader.low_fuses=0xE2
atmega328bb.bootloader.high_fuses=0xDA
atmega328bb.bootloader.extended_fuses=0x05
atmega328bb.bootloader.path=arduino:atmega
atmega328bb.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex
atmega328bb.bootloader.unlock_bits=0x3F
atmega328bb.bootloader.lock_bits=0x0F

atmega328bb.build.mcu=atmega328p
atmega328bb.build.f_cpu=8000000L
atmega328bb.build.core=arduino:arduino
atmega328bb.build.variant=standard

mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am

Re: atmega328P not accepting anything

Post by mtbf0 »

philipm wrote:The lilypad has a resonator on it, so doesn't use the internal oscillator. The fuse settings need to be different to enable the internal oscillator.
true enough. i was under the impression that the fuses were already set and that all that was needed was an appropriate target.

smkoberg
 
Posts: 55
Joined: Tue Aug 11, 2009 3:45 am

Re: atmega328P not accepting anything

Post by smkoberg »

Hey everybody! This *should* be my last post on this subject, but if it is not, we'll have bigger fish to fry. The board was populated yesterday with the new components (capacitors and resistors) and had no issues burning the bootloader and uploading the sketch. So far, everything is running perfectly. The board has been running for over 24 hours now with no hiccups, so I'm pretty sure I'm done!
Thanks to everyone who helped out! I'll probably make one last post with a video of the final project. Thanks again

philipm
 
Posts: 29
Joined: Tue Dec 27, 2011 10:50 am

Re: atmega328P not accepting anything

Post by philipm »

Grand! Is it all in time for the BANNED? Would love to see a clip of the finished effect. =)

smkoberg
 
Posts: 55
Joined: Tue Aug 11, 2009 3:45 am

Re: atmega328P not accepting anything

Post by smkoberg »

Ok, last post on this. I swear. I originally wanted to get 20+ of these boards finished so we could put a mason jar on each table at the BANNED, but unfortunately we couldn't get more than one done. So, I took what I had and stuck the board into a rectangular glass container with 5 candles in the lid and stuck them under a map at the BANNED. I took a video with my phone, so the quality might not be too great, also, the sound might be a tad high, and sound isn't really needed.

Thanks again to everyone who helped out on this project. Now all I have to do is work on making it better :D

http://youtu.be/nGaAl1yEglc

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”