This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP432P4111
Tool/software: TI-RTOS
Good morning,
I'm trying to implement a SPI communication between 2 devices. Both of them have the same cpu, a MSP432P4111.
I've been able to make them communicate using the examples spimaster_MSP_EXP432P4111_tirtos_ccs and spislave_MSP_EXP432P4111_tirtos_ccs. The problema I'm having is that when I change the pins I'm using the communication fails (it gets stuck in this fubcion: transferOK = SPI_transfer(masterSpi, &transaction);
This is the only thing I have changed:
{
.baseAddr = EUSCI_A3_BASE,
.bitOrder = EUSCI_A_SPI_MSB_FIRST,
.clockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK,
.defaultTxBufValue = 0xFF,
.dmaIntNum = INT_DMA_INT3,
.intPriority = (~0),
.rxDMAChannelIndex = DMA_CH7_EUSCIA3RX,
.txDMAChannelIndex = DMA_CH6_EUSCIA3TX,
.clkPin = SPIMSP432DMA_P9_5_UCA3CLK,
.simoPin = SPIMSP432DMA_P9_7_UCA3SIMO,
.somiPin = SPIMSP432DMA_P9_6_UCA3SOMI,
.stePin = SPIMSP432DMA_P2_3_UCA1STE,
.pinMode = EUSCI_SPI_4PIN_UCxSTE_ACTIVE_LOW,
.minDmaTransferSize = 10
}
I have chosen the pins 9.5 9.6 and 9.7 to be the SPI wires.
What's wrong? Any clue?
Thank you.
Hey user,
In spimaster.c, Board_SPI_Master (defined as MSP_EXP432P4111_SPIB3 in Board.h) is used to open SPI as the master, so this must be modified.
The code that you shared is found in MSP_EXP432P4111.c's DMA HW attributes const. Let's say you modified the third item, from A1 to A3. With this in mind, what you also want to do is update
const SPI_Config SPI_config[MSP_EXP432P4111_SPICOUNT]
This is right below the DMA HW attributes const. Replace the third item with MSP_EXP432P4111_SPIA3.
Then open MSP_EXP432P4111.h, and make sure that the 3rd item in
typedef enum MSP_EXP432P4111_SPIName
is MSP_EXP432P4111_SPIA3.
So to initialize your pins to use the device's peripherals, ensure that you're modifying MSP_EXP432P4111.h, MSP_EXP432P4111.c, and Board.h together this way.
BR,
Seong
With your help and some other modifications of the code I have maneged to make the SPI work. I still much to do to finish my Project but your help has been extremely important.
Thank you very much.
**Attention** This is a public forum