When I had a look at this link, I was wondering if the 2nd SPI Header (MOSI2, MISO2, SCK2) is a completely different bus than the first one (MOSI, MISO, SCK).
In the pin-out it looks like they are 2 different buses but I don't know how I could select the 2nd one, since you just provide the function with the SS pin. (e.g. "SPI.begin(4)")
Is it the same bus, just two connection possibilities or am I misunderstanding something?
Background: I use a display shield that occupies the 1st SPI Header and I want to connect a thermocouple amplifier which uses the spi bus, too.
In the pin-out it looks like they are 2 different buses but I don't know how I could select the 2nd one, since you just provide the function with the SS pin. (e.g. "SPI.begin(4)")
The hardware has two separate SPI buses but the Arduino SPI library supports just the first one of them out of the box.
Background: I use a display shield that occupies the 1st SPI Header and I want to connect a thermocouple amplifier which uses the spi bus, too.
It's a bus so it's possible to share the bus with several devices as long as you choose a different SS pin for every device.
The hardware has two separate SPI buses but the Arduino SPI library supports just the first one of them out of the box.
I just took a look at the datasheet, and that doesn't actually appear to be the case. There is indeed a second SPI port mentioned, but the port it is on does not exist on the 144 pin package. It only exists on a 217 pin package that isn't yet commercially available.
Page 48:
11.3 Peripheral Signal Multiplexing on I/O Lines
The SAM3X/A series product features 3 PIO (SAM3A and 100-pin SAM3X) or 4 PIO (144-pin
SAM3X) or 6 PIO (217-pin SAM3X8H(1)) controllers, PIOA, PIOB, PIOC, PIOD, PIOE and PIOF,
which multiplexes the I/O lines of the peripheral set.
Note that some peripheral function, which are output only, might be duplicated within both
tables.
Note: 1. This device is not commercially available. Mounted only on the SAM3X-EK evaluation kit.
Indicating those ports are only on the 217 pin package.
So I guess if you can't use multiple devices on a single SPI bus for whatever reason, you've either got to put one of the USARTs into SPI mode or bit bang it.
Oh, and that ICSP header that looks like a second SPI port is actually for programming the Atmega16U2 on the board which assists with programming the SAM3X chip through the second USB port.
Note there's possibly several more SPI interfaces if you use SPI mode of USART0 and USART1. Check table 36-1, 36-2 and 36-3 in the SAM3X datasheet. I'm not sure if there's a library or what examples may exist on this feature.
Regards, dlloyd