Go Down

Topic: Atmega328p Programming (Read 817 times) previous topic - next topic

cand3llax3

Hi guys ,

So , I programmed the atmega328 of the arduino uno to just blink a led. Then I unplugged it and put it on a breadboard . I did all the necessary connections and it didn't work BUT when i plugged it back and connected the led to the specific pin it worked perfectly.

Note:
- I checked the connections 100 times. I also saw a pin map of the atmega328 so I don't think that's the problem.
- I used a 16MHz crystal but used 47 and 82 pF capacitors instead of 22pF. Do you think that's the reason it fails to work outside of the board?
- I also can't program it on the way arduino website suggests.It just keeps saying double check the connections..

Thanks in advance!

larryd

Show us a good schematic of your circuit. 
Show us a good image of your wiring.


.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

steve_mcdonald

Those capacitors are important for both timing and the shape of the clock.  The range specified is small - 18 to 22 pF.  You will need to replace the capacitors with two that are matched and within that range.

DrAzzy

Yeah. On breadboard, sometime you don't even need any loading caps due to parasitic capacitance. But 47+pf would keep it from working for sure.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

cand3llax3

Thank you for your answers,

So I managed to burn the bootloader on the atmega328 by using an 1μF capacitor from reset to gnd.
When I try to upload the blink program I get this error:

{

 Warning: Board breadboard:avr:atmega328bb doesn't define a 'build.board' preference. Auto-set to: AVR_ATMEGA328BB

}

Followed after a couple of minutes of this:

{

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x91
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x91
Problem uploading to board
}

Also why is the builtin led blinking after the burning?

jremington

#5
Oct 07, 2017, 05:53 pm Last Edit: Oct 07, 2017, 05:53 pm by jremington
Quote
Also why is the builtin led blinking after the burning?
The "burning" failed. The blinking you see is probably due either to the bootloader, or the program you loaded earlier.

Go Up