0
\$\begingroup\$

Looking at features of xmega avr mcu here: https://www.microchip.com/wwwproducts/en/ATxmega32A4 I am wondering why there is so big support of spi or i2c. There are 5 spi buses. What is the practical use? I2c and even spi can use the same bus for many counterparties and even when there is hardware support, so you can really communicate on more buses at once, i cannot imagine need for 5 spi buses.

So the question is: Do you have any real world example of such use? I can imagine external memory having its own bus as advantage. Anything else?

\$\endgroup\$
  • \$\begingroup\$ somewhat related: Why the need for multiple I²C ports? (but that question goes only as far as 2x buses, not 5x) \$\endgroup\$ – Nick Alexeev Jun 13 '18 at 19:35
  • \$\begingroup\$ Thanks, ive missed that one. Different speeds is one good point. \$\endgroup\$ – Divisadero Jun 13 '18 at 19:39
  • \$\begingroup\$ Useful for parallel (or near parallel) transactions, reduces load on buses (speed, dynamic power). \$\endgroup\$ – HKOB Jun 13 '18 at 20:00
3
\$\begingroup\$

Layout

For the PCB, the most important thing if you have many chips on the bus, is the impedance matching. If you separate the buses, it's easier, because you don't need to think (or less) about routing topology.

Frequency of reading on the chip

Using one chip by bus, you can increase the frequency of reading value on the chip. Because when a bus is running, you can use another.

If you use the DMA, it's even more important. Because while a channel is used, the DMA can sent value to another.

Bus configuration

If you have different chip with different bus configurations like:

  • Clock frequency
  • Signal phase
  • Signal polarity

You don't need to re-configure the bus between two accesses.

summary

The choice depends on your project, but if you have enough free pin to separate your boss, do this.

\$\endgroup\$
2
\$\begingroup\$

Programming simplicity

You don't have to worry about arbitrating inside your program, or choosing how to prioritise access to the bus; just put them on different buses and control them from different interrupt handlers.

Electrical simplicity

Less bus loading to worry about, and the routing may be simpler rather than having to put all the devices on a long bus, especially if they're on opposite sides of the PCB.

Duplicate IDs

You can easily address two of the same peripheral with the same ID by putting them on different buses.

\$\endgroup\$
1
\$\begingroup\$

Small add-on to pjc50's answer:

PCB layout

If you have 5 identical peripherals they obviously are not connected to the same pins in the package, so even if you use only one of them you can effectively choose which pins you want to use - this helps in PCB design.

On the other hand - different MCUs can have less peripherals but a more complicated multiplexing network that allows you to choose which pins should be allocated to a particular peripheral.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.