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.

MSP430FR6043: UltrasonicWaterFR6043 example project with SPI communication

Part Number: MSP430FR6043

Hi!

 

My environment:

CCS: 10.1
MSP SDK: 3.80.10.09
CC SDK: 4.30.00.54


Devices:

MSP430FR6043
Launchpad CC1352R1 rev. B

Problem:

I created example project from UltrasonicWaterFR604x_02_40_00_00. I want to connect CC to MSP with SPI, where MSP working as a slave. I added my SPI driver implementation in comm/drivers/ and another option in comm_config.h (COMM_SPISLAVE).

I configured SPI on EUSCI_A_SPI with P4.2, P4.1, P4.3 and P4.4 pins. Also I added two GPIO pins for handshake (P3.1 and P4.0). At this moment everything seems to work fine, GPIO handshake is working and I have interrupt on P3.1, but SPI interrupt is never invoked.

Setup on MSP:

// Params:
param.msbFirst = EUSCI_A_SPI_MSB_FIRST;
param.clockPhase = EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT;
param.clockPolarity = EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW;
param.spiMode = EUSCI_A_SPI_4PIN_UCxSTE_ACTIVE_LOW;

EUSCI_A_SPI_select4PinFunctionality(EUSCI_A0_BASE, EUSCI_A_SPI_ENABLE_SIGNAL_FOR_4WIRE_SLAVE);
EUSCI_A_SPI_enable(EUSCI_A0_BASE);
EUSCI_A_SPI_clearInterrupt(EUSCI_A0_BASE, EUSCI_A_SPI_RECEIVE_INTERRUPT);
EUSCI_A_SPI_enableInterrupt(EUSCI_A0_BASE, EUSCI_A_SPI_RECEIVE_INTERRUPT);

// and Interrupt:
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void) { ... }

Setup on CC:

params.transferMode = SPI_MODE_CALLBACK;
params.frameFormat = SPI_FrameFormat::SPI_POL0_PHA0;
params.bitRate = 10000;
params.mode = SPI_Mode::SPI_MASTER;
params.dataSize = 8;


I start transfer from CC side, and working like a charm with example spi project from MSP SDK (eusci_a_spi_ex1_slave), but in UltrasonicWaterFR604x_02_40_00_00 example project it's never reach SPI interrupt.

How can I fix it?

**Attention** This is a public forum