Our application is implementing a synchronous interface as a SPI Slave. The communication protocol is half duplex so the driver is either receiving or transmitting. The clock phase and polarity are defined by a standard and we cannot change them. It can run for days, months and forever but occasionally the UCB0 will issue the Receive Interrupt after the 7th clock edge on every receive byte. The data in the receive buffer is either shifted by one bit or sometimes the contents of the transmit buffer shifted by a byte. Before every receive transaction the UCI is reset and configured. It sometimes requires several POR to clear the condition and it will not reoccur for weeks. It only 1 component of a system and it is very inconvenient to power cycle the entire device and the unit has to be physically opened to reset the MSP430. It has started to show up in the field and is becoming very troublesome. I have attached captures of good and bad reception sequences. The Receive interrupt sets an clears an IO pin which lets us know when it occurs.
Spi receive initialization
{ volatile uint8_t dummy; // SPI communication StopFlashWrite = true; UCB0CTL1 = UCSWRST; RcvState = R_DEVT_1; RcvCount = 0; XmtCount = 0; checkSum = false; errorCode = 0; UCB0TXBUF = 0xDE; P3SEL = CEAMoSi | CEAClock; P3DIR &= ~(CEAMiSo | CEAMoSi | CEAClock); UCB0CTL0 = UCMSB + UCSYNC + UCCKPH; UCB0CTL1 &= ~UCSWRST; // Release reset dummy = UCB0RXBUF; EnableRxInterrupt(); }
Correct Receive Timing
Incorrect Timing show entire handshake. On receive of 4 byte, the message is determined to be corrupted and receive aborted.
Same capture, at a higher resolution.
Regards,
Paul Terricciano