Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
interjaz
PostPosted: Mar 11, 2010 - 07:19 AM
Newbie


Joined: Oct 12, 2008
Posts: 9
Location: Poland

Hi,

I've tried to find the answer, how to program two or more AVR uC (ATmega especially) on one board using only one ISP connector.

Would jumper linking RST (SPI) with Reset pin of ATmega (which is going to be programed) is a solution? Is it better way to do it?

Thanks, for answers.
 
 View user's profile Send private message  
Reply with quote Back to top
Heisann
PostPosted: Mar 11, 2010 - 07:55 AM
Hangaround


Joined: Jan 13, 2004
Posts: 113


It's best to jumper the clock signal. That way all devices is held in reset while one is programmed.
 
 View user's profile Send private message  
Reply with quote Back to top
interjaz
PostPosted: Mar 11, 2010 - 08:07 AM
Newbie


Joined: Oct 12, 2008
Posts: 9
Location: Poland

So, if I understand you right, I should insert jumper to all uC (for example on their XTAL1 pin).

While programming only one is inserted, and while running all are inserted, right?
 
 View user's profile Send private message  
Reply with quote Back to top
ltdor
PostPosted: Mar 11, 2010 - 08:08 AM
Wannabe


Joined: Aug 13, 2003
Posts: 88
Location: Romania

I had only troubles doing the same in the past. Maybe because the SPI line was also used for communication between ATmegas.
You have to put a jumper between each reset pin and the shared ISP connector anyway so what is the space difference between a jumper and a small 6 pin ISP connector ? Not too much considering you don't have to route traces between the shared pins of ATmegas.

I would use a 2x3 pin header with 1.25 or 2mm pitch for each ATmega. Other idea is to leave the pin header unsoldered if you have a PTH board. Another idea is to use a 4x1 pin small header for each ATmega for SCK, RESET, MISO, MOSI and take the power from a common place.

interjaz wrote:
So, if I understand you right, I should insert jumper to all uC (for example on their XTAL1 pin).

While programming only one is inserted, and while running all are inserted, right?


No, he is talking about the SPI clock (SCK)
 
 View user's profile Send private message  
Reply with quote Back to top
Heisann
PostPosted: Mar 11, 2010 - 08:27 AM
Hangaround


Joined: Jan 13, 2004
Posts: 113


interjaz wrote:
So, if I understand you right, I should insert jumper to all uC (for example on their XTAL1 pin).

While programming only one is inserted, and while running all are inserted, right?


No, the ISP clock signal, SCK.
 
 View user's profile Send private message  
Reply with quote Back to top
interjaz
PostPosted: Mar 11, 2010 - 09:25 AM
Newbie


Joined: Oct 12, 2008
Posts: 9
Location: Poland

Thanks for quick response.

I'll try to do SCK jumper.
Rest SPI lines can be common? What about RST can it be common too? Maybe I ask silly questions but I would like to be 100% sure before making a PCB.

Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
Heisann
PostPosted: Mar 11, 2010 - 09:40 AM
Hangaround


Joined: Jan 13, 2004
Posts: 113


It depends a bit on what you are your AVRs are going to do. Do they communicate with each other, or with their own SPI slaves? If they all use the SPI bus, you must implement some kind of bus mastering system technique.
 
 View user's profile Send private message  
Reply with quote Back to top
interjaz
PostPosted: Mar 11, 2010 - 10:47 AM
Newbie


Joined: Oct 12, 2008
Posts: 9
Location: Poland

Well, I'm going use SPI only for programming, there will be no SPI communication between them.

In these case SCK will be separated (jumper), other SPI (MISO, MOSI) will be common. (right?)

But my question is do I have to separate the RST form ISP too. The other AVR may stop working for the time of programming the first one.

Or maybe the idea of making two 3x2 pins for ISP is better idea?
 
 View user's profile Send private message  
Reply with quote Back to top
ltdor
PostPosted: Mar 11, 2010 - 11:04 AM
Wannabe


Joined: Aug 13, 2003
Posts: 88
Location: Romania

The RST line must be common too to ensure that software in uC2 won't interfere with uC1 programming.

Otherwise while programming uC1, any bug in uC2 software might interfere with the common lines (MISO, MOSI). The uC1 might be loaded with corrupted software and you might search the cause for days.

Keep things simple and everybody will be happy.
 
 View user's profile Send private message  
Reply with quote Back to top
interjaz
PostPosted: Mar 11, 2010 - 12:17 PM
Newbie


Joined: Oct 12, 2008
Posts: 9
Location: Poland

OK, thank you for the answers.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits