Go Down

Topic: program an atmega328 with a mega (Read 1 time) previous topic - next topic

winner10920

Im planning on putting an atmega 328 onto a shield im making for a mega2560, what would I need to program it on the shield? I imagine I would have to have the serial connected between the two, like miso, mosi, ss, cs but is that it? I have an uno I can just pop it in to reprogram and I probably wont need to but id like to add the capability to the shield in case I want to in the future, I've never even used it as a programmer so I don't know what connections need to be made

sbright33

You mean load a sketch?  TX,RX,RST,5V,G
I'm trying to do something similar but it's not working.
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

winner10920

how are you trying to do it? I imagine something like setting the option using arduino as isp, then it just working lol
I hope its that simple, it makes sense if its just reset, rx,tx,5v,gnd
I was just thinking is there a way to tap into the rx,tx pins of a mega and have it go to the other board? I think those lines are from the atmega 8u2 which does the usb to serial, so technically if there was a way to make the mega ignore the transmission the other atmega can use that comm directly?
would having like a 3way switch on the autoreset pads work? That should allow the data to pass to the atmega328 with the mega bypassed, or viceversa so long as the new program has the tx/rx lines set as input right?

Dr_Ugi

I'm not sure what the autoreset pads are but I think you are probably suggesting what I was thinking - if you ground the reset pin of the Mega (but obviously not that of the '328) then it will not be able to respond to the serial signals.  Therefore, if you connect your shield to the reset, tx and rx pins, you could have something like DIP-switches to ground the Mega's reset pin and connect your '328 to the tx & rx lines.  Sounds like it would work to me.

sbright33

http://arduino.cc/en/Tutorial/ArduinoToBreadboard
If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

winner10920

Ok tnat confirms the idea that all I need is rx,tx, rst,5v,gnd
but the part im still assuming on is that the bootloader wont do anything unless reset at the proper time right? So if atmega328 is reset and code gets uploaded it will not affect the, mega

Dr_Ugi

Can you use and Arduino Mega as an ISP?  I thought that was available on '328 based boards only.

winner10920

Im not sure, but I think with this way it doesn't mattter since technically the mega is just being bypassed,  so the atmega328 still needs a bootloader and is acting as if the mega was never there

Go Up