Switching between slaves (SPI)

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi! I'm currently working on a project which uses Atmel Studio in combination with an AVRISP. I'm not familiair with Atmel or programming in general. I have one programmer and 10 slaves and I'm trying to switch between the slaves because Atmel can only see one device at the time. I tried switching the ground but that doesn't work. I already figured out the programmer uses a SPI with an MOSI, MISO, RST, VCC and GND signal. I tried switching between devices using the RST/SS but that doesn't work either. I just can't figure out a way to switch between slaves. I hope someone on this forum can help me out!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to AVRFreaks!

 

Niek Kronemeyer wrote:
I have one programmer and 10 slaves

Its unclear what your question is, are you trying to program multiple AVRs using ISP, or is this an SPI one master multiple slave application?

The two terms are similar, ISP vs SPI, and the underlying transport is the same, but are two different protocols!

 

Jim

edit: it would help to know what AVR you are talking about as well.

 

 

 

 

Last Edited: Thu. Mar 12, 2020 - 01:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have one programmer (master) and 10 slaves. The programmer uses SPI to communicate between the slaves. I think you can call this an SPI one master multiple slave application. I'm using an AVRISP MKII Main Uni.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In SPI you select slave by only pulling ONE low at a time - the others that are not being addressed should tri-state so they don't interfere with the one-to-one dialog that is going on between master and the one active slave.

 

The equivalent in ISP would be the chip _RESET lines. The only chip that would be in "ISP mode" is the one that happens to have its _RESET pin pulled low while the dialog progresses. So you need some kind of "multiplexer" to arrange that only one out of the 10 has _RESET pulled low at any one time. Then have 10 individual programming dialogues.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Sorry your description is getting lost in translation, either you are trying to program multiple AVR's (slaves?) or you have an application where one AVR wants to talk to multiple slaves, which is it?

Perhaps a clear photo would help. 

 

If your trying to program multiple AVRs, take a look at this: https://www.sparkfun.com/tutoria...

Note the AVRISP's used in this tutorial are no longer available, but this solution uses one ISP programmer per AVR to be programmed.

 

If your trying to use SPI to communicate with multiple slave AVRs, then one of two methods is used, see diagram below:

does that help?

 

Jim