Pages: [1]   Go Down
Author Topic: program an atmega328 with a mega  (Read 907 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You mean load a sketch?  TX,RX,RST,5V,G
I'm trying to do something similar but it's not working.
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

London
Offline Offline
Full Member
***
Karma: 0
Posts: 146
Ugi was not declared in this scope
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Edison Member
*
Karma: 8
Posts: 1341
If you're not living on the Edge, you're taking up too much space!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/en/Tutorial/ArduinoToBreadboard
Logged

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

London
Offline Offline
Full Member
***
Karma: 0
Posts: 146
Ugi was not declared in this scope
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: