Hello,
long time I didnt have any further questions in the MSP430 which couldnt be solved by myself, but here I am back with another tricky one:
I do use the SPI_B1 on my MSP430F2617, that would be on Pins P5.1---5.3 or so, I state this cause mybe there is already an error.
I am pretty expirienced when it comes to SPI setting and so forth, so I am puzzeld here.
I am trying to shift out Temperature data from an TMP121 chip, this one only shifts out data if you pull down its CS and put in a clock, then it will give you back temperature in digital format, I did proof that in another setup with another MSP, the MSP430F5529 to be precise, everything works as planned.
Here is some snipped of my code:
unsigned char TMP121_ReceiveByte(void)
{
unsigned char Result = 0;
while(!(UCB1IFG&UCTXIFG)); // Make sure nothing is currently transmitting
UCB1TXBUF = 0xff; // Send out NOP to initiate SCLK
while(!(UCB1IFG&UCRXIFG)); // Wait until all data is transmitted (received)
Result = UCB1RXBUF; // Capture the receive buffer
return Result;
}
P5OUT &= ~BIT4;
int16_TempBin = TMP121_ReceiveByte();
int16_TempBin = (int16_TempBin << 8);
int16_TempBin |= TMP121_ReceiveByte();
__no_operation();
int16_TempBin = int16_TempBin >>3;
f32_Temp= 0.0625*(int16_TempBin);
TempSensor = f32_Temp;
P5OUT |= BIT4;
So the code i sworking fine in the SPI B0 of the MSP430F5529 but it is not working correct in the MSP430F2617.
I am wondering if one is using the UART SPI and the other one the USCI sPI if there could be some different flags involved, since it is almost working fine but the last clock cycle.
Or maybe there is a known issue with the silicon???
I will try to fix an workaround by simply sending one more dummy byte, which i actually dont neew.
Any help appreciated.
Thanks.
seb