Other Parts Discussed in Thread: MSP430F5529, MSP430WARE
Hello,
I have a MSP430F5529 Launch Pad Evaluation Kit (using CC5.5). I am trying to get the SPI slave example in
C:\TI_CC55\MSP430ware_1_97_00_47\driverlib\examples\MSP430F5xx_6xx\usci_b_spi\CCS working. I made changes to use the correct linker.cmd, etc. for the 5529 part.
The issue I am having is that I am not getting any receive interrupts.
The Evaluation Kit is attached via SPI to another board acting as the MASTER (MODE 0). I have verified that the data coming from the MASTER into the Evaluation Kit is correct via a scope.
The pins I am using on the Evaluation Kit are:
| P3.2 | UCB0CLK | |
| P3.0 | UCB0SIMO | MOSI |
| P3.1 | UCABSOMI | MISO |
The code is as follows (pretty much verbatim from the TI example):
void main(void)
{
//Stop watchdog timer
WDT_A_hold(WDT_A_BASE);
//If clock signal from master stays low, it is not yet in SPI mode
while(GPIO_INPUT_PIN_LOW ==
GPIO_getInputPinValue(
GPIO_PORT_P3,
GPIO_PIN2
))
{
;
}
GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_P3,
GPIO_PIN1 + GPIO_PIN2 + GPIO_PIN0
);
//Initialize slave to MSB first, inactive high clock polarity and 3 wire SPI
returnValue = USCI_B_SPI_slaveInit(USCI_B0_BASE,
USCI_B_SPI_MSB_FIRST,
USCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT,
USCI_B_SPI_CLOCKPOLARITY_INACTIVITY_LOW
);
if(STATUS_FAIL == returnValue)
{
return;
}
//Enable SPI Module
USCI_B_SPI_enable(USCI_B0_BASE);
//Enable Receive interrupt
USCI_B_SPI_clearInterruptFlag(USCI_B0_BASE,
USCI_B_SPI_RECEIVE_INTERRUPT
);
USCI_B_SPI_enableInterrupt(USCI_B0_BASE,
USCI_B_SPI_RECEIVE_INTERRUPT
);
//Enable interrupts
__bis_SR_register(GIE);
}
#pragma vector=USCI_B0_VECTOR
__interrupt
void USCI_B0_ISR(void)
{
switch(__even_in_range(UCB0IV,4))
{
//Vector 2 - RXIFG
case 2:
//USCI_A0 TX buffer ready?
while(!USCI_B_SPI_getInterruptStatus(USCI_B0_BASE,
USCI_B_SPI_TRANSMIT_INTERRUPT
))
{
;
}
//Transmit data to master
USCI_B_SPI_transmitData(USCI_B0_BASE,
transmitData
);
//Receive data from master
receiveData = USCI_B_SPI_receiveData(USCI_B0_BASE);
//Increment data to be transmitted
transmitData++;
break;
default: break;
}
}
After running and pausing the execution on the Evaluation Kit, the data I see in the USCB0RXBUF_SPI is correct. I can run and pause and the RX buffer register continues to update with the correct data from the master.
UCB0IE_SPI shows that the RX interrupt is ENABLED.
UCB0IFG_SPI shows that there is a receive as well as a transmit interrupt PENDING.
UCB0IV_SPI shows => Interrupt Source: Data received; Interrupt Flag: UCRXIFG; Interrupt Priority: Highest
Any ideas on why my interrupt handler is not being hit?
Any help would be great.
Thanks,
Brent
