Modify the variant.h/cpp files to change the default SPI pins

Hi, I designed a custom board with the ATSAMD21G18A MCU but I followed the wrong schematics for the SPI pins i found on the forum that i can change the default SPI pins in the variant files did some test but is not working :frowning:
image


The MCU is connected to an NRF24L01 chip
these are the pins that i want to use for the SPI (similar to the Arduino UNO/nano)
pa16 Mosi SER 1:0 3:0
pa17 Sck SER 1:1 3:1
pa19 Miso SER 1:3 3:3
Pa18 ss SER 1:2 3:2

PA16 is PAD[0] for DataOut
PA17 is PAD[1] for SCK
PA18 is PAD[2] for SS
PA19 is PAD[3] for DataIn

for SERCOM1 and SERCOM3 (so lots of options relatively speaking)

According to here, you can change the register settings DIPO and DOPO to the following to match your configuration

How to translate this changes to this variant file, I have no idea, but it can be done using "low-level" register changes.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.