Go Down

Topic: Standalone ATmega328 with bootloader sketch upload (Read 1 time) previous topic - next topic

xaxxx

I'm very knew to the entire arduino scene - just started playing with arduino uno. If one would like to upload a sketch to an atmega328 that was already burned with a bootloader, I imagine that the arduino board could be used. RX, TXD, VDD, GND and RESET are the pins needed from the board to the standalone atmega, correct? I don't want to start fiddling with my new board without a second opinion.
Thanks

spycatcher2k

Correct - plus you would need a 10K resistor for the reset pullup, and a 16Mhz Crystal with supporting caps as well.
Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

xaxxx

Thanks a lot spycatcher. I guess the downside of using this method would be that the sketch would be uploaded also to the atmega sitting on the arduino board.

CrossRoads

No. You could put  the installed ATmega into a reset condition, and have the new part be the only one responding.
Alternately, you could get a standalone USB/Serial adapter, and not need the original Arduino at all.
http://www.sparkfun.com/products/10009
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

xaxxx

You mean RESET to GND, crossroads? I think I will use the USB to TTL adapter that I already have. I guess I didn't want to use it because the DTR line was not soldered to any pin header and didn't feel like warming up the soldering iron  :smiley-roll:

CrossRoads

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

xaxxx

Thanks crossroads.
The problem is that I couldn't upload any sketch to the new mcu and so I thought that something was wrong with the bootloader. Trying to re-burn the bootloader, using the same method I used previously with success, I'm getting the error:
"avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check."
Is the chip faulty?

CrossRoads

The problem with that setup is that you have 2 uC running in parallel.
I think you need to pull reset low on the SMD arduino, and let the other be controlled by its pullup resistor.
When you want to download, start the sketch download, press & hold the DIP part's reset button; when the IDE says "compiled xxx of 32xxx bytes" , release the DIP part's reset button.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

xaxxx

After few hours of tinkering with the connections, a lot of scenarios and IDE and getting all sorts of errors with ArduinoISP, I managed to use the optiboot fixer on the mcu. There are few issues left:
1. If I replace on the arduino uno board the new mcu with opti, I can upload a sketch only if I select "arduino duemilanove w/ atmega328". For the original mcu, "Arduino uno" still works.
2. The mcu on the breadboard doesn't execute the code: a simple "hello world", the "Blink" sketch. Maybe the problem is with the oscillator: http://parts.digikey.com/1/parts/403831-cer-resonator-16-00mhz-ztt-16-00mx.html - that seems to have the built in caps.

CrossRoads

"CER RESONATOR 16.00MHZ"
Yes, a resonator has built in cap's.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

xaxxx

I don't know how important is the value of the filter caps, everywhere it says 18-22pf and I saw in the ceramic resonator datasheet that its caps are 30pf.

SirNickity

Careful.  Resonators don't always have built-in caps.  I have both in my parts bin, purchased from Digikey.

I use 27pf caps pretty much all the time.  I have 20 and 30 as well, in case I ever need to fine-tune the frequency, but I haven't yet had any occasion to bother.  Use the crystal cap formula (5-8pF trace capacitance is usually a safe assumption) if in doubt, using the datasheet load capacitance as a guideline.

Or just buy a three-pin resonator.

xaxxx

I've working with PICs and didn't pay much attention to the filter caps of the oscillator. With arduino I got the feeling from what I read that the caps have to be 18-22 pf and couldn't understand why.
The resonator that I have has 3 pins and it seems to be working fine.

CrossRoads

"The resonator that I have has 3 pins and it seems to be working fine. "
The part # you provided a link for, the spec for it says it has internal caps.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Go Up