rauross
(Gert Rautenbach)
February 9, 2021, 1:18pm
1
Hi
Did anyone do a SPI application with the RAK4260? SERCOM5. Pins 22 to 25.
Last part on this page : RAK4260 Evaluation Board Datasheet | RAKwireless Documentation Center
Then in the example code : src/ASF/sam0/boards/samr34_xplained_pro/samr34_xplained_pro.h
/** \name Extension header #1 SPI definitions
@{
*/
#define EXT1_SPI_MODULE SERCOM5
#define EXT1_SPI_SERCOM_MUX_SETTING SPI_SIGNAL_MUX_SETTING_E
#define EXT1_SPI_SERCOM_PINMUX_PAD0 PINMUX_PB02D_SERCOM5_PAD0
#define EXT1_SPI_SERCOM_PINMUX_PAD1 PINMUX_PA23D_SERCOM5_PAD1
#define EXT1_SPI_SERCOM_PINMUX_PAD2 PINMUX_PB22D_SERCOM5_PAD2
#define EXT1_SPI_SERCOM_PINMUX_PAD3 PINMUX_PB23D_SERCOM5_PAD3
PB22 is pin 9 on the datasheet.
This is all too confusing for me.
Hope someone can help.
Regards
Gert
carlrowan
(Carl Rowan)
February 9, 2021, 3:42pm
2
Hi Gert,
I haven’t developed any SPI enabled sensors/device to RAK4260. But based on ATSAMR34 datasheet, PA22 or PB22 can work.
Only SERCOM4 must be avoided since that is the one connected to the LoRa transceiver.
OlegK
(OlegK)
October 18, 2022, 3:53pm
3
Let me necro that.
RAK4260 has SPI pins placed as follows:
MISO - PB02, SERCOM5 PAD0
CLK - PB23, SERCOM5 PAD3
CS - PA22, SERCOM5 PAD0 (does not matter for R34 master, 'cause it’ll be GPIO pin)
MOSI - PA23, SERCOM5 PAD1
The last pin is the crux of a problem, I think. SAMR34 uses SAML21 core and peripherals. However, SAML21 SERCOM does not allow to assign MOSI pin (DO) to PAD1 under any configuration (see p560 of SAML21 revC datasheet).
Correct me if I am wrong, but I believe master SPI interface, as designed into RAK4260, is (ed : not usable when attaching SPI slave per pin name).