cancel
Showing results for 
Search instead for 
Did you mean: 

PMOD interaface sample pin configuration code

AGumm
Associate II

Hi Team,

Am working with STM32L4R9 Discovery board,

In this SOC, PMOD interface is configured to UART in default

  • When am trying to use this a SPI interface, am facing issue
  • Can you pls share me the sample pin configuration for PMOD connection to configure for SPI (pins which are projected out to test and connect).
7 REPLIES 7
Syeli
Associate II

Hi Team,

Even i'm also facing the same issue with the above setup.

As per the specification doc,configured the Quad SPDT switch configuration,to use the SPI pins in PMOD connection.

quad SPDT switch conf:

  • STMOD+_SEL_0 (GPIO6 of MFX_V3 i.e. PA6) to 0
  • STMOD+_SEL_1 (GPIO7 of MFX_V3 i.e., PA7) to 0

But still the spi interface issue is existing .

So request your help in solving the issue.

Note:Below are the PMOD spi pins which i was trying to use after configuring the Quad SPDT switch .

1 SPI2_CS/USART3_CTS (PA6)

2 SPI2_MOSIp/USART3_TXD (PB15/PB10)

3 SPI2_MISOp/USART3_RXD (PB14/PB11)

4 SPI2_SCK/USART3_RTS (PB13/PA15)

+

AGumm
Associate II

Hi Team,

Its been a week,am blocked at this state.....

Let me put my work in words as below to make understand much better...

"We are working with STM32L4R9 Discovery board. When trying to use SPI2 on PMOD we observed that, by default SPI MOSI and MISO pins are configured to USART3_TXD and USART3_RXD respectively.

As per the user manual (UM2271 User manual - Discovery kit with STM32L4R9AI MCU - Page 39), to enable SPI2 on PMOD, it requires a change in MFX_V3 circuit configuration.

We are unable to find the steps required for configuring MFX_V3 circuit.

Could you please help us with sample code or any other steps to enable SPI2 on PMOD?"

and move out for this blocker

S.Ma
Principal

0690X0000089dkmQAA.png

Remove SB20,16,18 if you still need the USART for arduino, otherwise, put these pin as digital input (HiZ)

Solder short SB21,17,19 and you'll have SPI2 on STMod+ and PMOD connectors 1,2,3,4

Syeli
Associate II

Thanks for the update.

can't we do samething from the software instead of soldering?

Thanks in advance!

S.Ma
Principal

Unfortunately, the discovery board MCU package doesn't have enough pins to make things easier.

I noticed that some other disco use MCU controlled digital mux to avoid soldering.

AGumm
Associate II

Thanks for update,

As mentioned in hardware specs shown above....we understood that with i2c these pins can be configured....can you pls suggest us the way to configure these through code.

I mean software configuration to make this up working

Syeli
Associate II

Hi Team,

By setting the pins GPIO6 and GPIO7 to 0 by using below code snippet we were able to use the spi pins in PMOD.

code snippet:

---------------------------------

BSP_IO_WritePin(IO_PIN_6|IO_PIN_7, GPIO_PIN_RESET);

BSP_IO_ConfigPin(IO_PIN_6|IO_PIN_7 ,IO_MODE_OUTPUT);

--------------------------

could you please confirm whether we can proceed with the above configurations ?