Driving fast and slow slaves on the same SPI instance.

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

Hi,

 

I'm running on an AT32UC31512C and controlling 4 different SPI slaves using two SPI instances, SPI_0 and SPI_1.

 

I think I can run the different SPI instances at different clock rates, but  can I run a fast slave and a slow slave on the same SPI instance?  Or do slaves with the same input data rate need to be on the same spi_instance?  If I need to run a fast slave on the same instance as a slow slave, can I toggle between clock rates easily and without consequence?

 

Thanks!

Fred

 

 

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

Welcome, Fred!

 

Don't know anything specific about UC3 devices but do know a bit about SPI.

 

Fact 1: An unselected device is totally oblivious to what else is going on, on that bus. Well, it SHOULD be totally oblivious, but that may vary according to the device manufacturer. 

 

Fact 2: As a consequence of Fact 1, you can change the clock rate while devices are unselected, and nothing should care.

 

Fact 3: When you begin a transaction (by selecting a device and starting a transfer), it will run at what ever the selected clock rate is. Other devices should care less.

 

So, as far as I understand, you can toggle clock rates to your heart's desire so long as you do it when all the devices are deselected.

 

Jim

 

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Makes sense.  Thanks, Jim!

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

Each AVR32 SPI module (SPI0, SPI1, ...) has 4 configuration of SPI parameters (baudrate, mode, delays, etc), one for each 'chip select'.
When you 'select' a chip it will load and use the specific settings for that device.

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

Perfect - that's what I needed to know.  Thanks, mikech.