Hi everyone,
I'm struggling to understand how to configure SERCOM 5 to use SPI.
I know that I have to define the right pins on the variant file, but what I don't understand is the association between a pin and a SERCOM PAD.
I wasn't able to find the info on the datasheet that would tell me if MOSI (but also SCLK) can be PAD 0, 1, 2 or 3.
I have also the following questions regarding the Arduino SPI library:
is it possible to free MISO and then use that pin as a GPIO? I only need MOSI.
is it possible to use hardware controlled SS (Client Select) ?
I'm just starting out with the SAM devices so this may be of little help to you, and possibly wrong (!), but, the SAM-D5x-E5x datasheet has a section 6 called I/O "Multiplexing and Considerations". There's a table in that section called "Multiplexed Peripheral Signals" that I think shows you the SERCOM pad number (0..3) and its associated physical pin on the device.
thanks, yes I read that section but it's not clear to me whether a SERCOM signal like MOSI can be mapped to any SERCOM PAD between 0-3 or not.
For example, when I configured USART, TX (or RX) couldn't be mapped to any PAD between 0-3 but only to a subset (probably to 0 and 2, can't remember). It's not clear to me the same about SPI signals.
thanks again,
yes I read that guide and that's where my confusion started. Indeed the guide says:
It looks like SCK can only be on pad 1 or 3 , and MOSI can be on 0 , 2 , or 3 depending on the configuration.
but I can't find any reference to that in the datasheet. I'm wondering if is just a configuration in the SPI library and not directly related to the microcontroller.
thank you, that solved my doubts! I also did a test with the pinout suggested there (but moved to SERCOM 5) and everything works fine. I also managed to spare the MISO pin since I don't need it, all I had to do was to use pinMode on that pin after SPI.begin()