Hey there, I have a communication Problem with my MSP430F2013 in Master mode. The µC just doesnt shift the Data out. In fact, it doesnt even provide a clk Signal at the pin. Do you have an idea what`s the matter?
I am using IAR Kickstart 6.20 by the way..
Here is my code for the SPI communication:
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer in order to prevent timeout reset
USICTL0 |= USISWRST; // USI stopped
USICTL0 |= USIPE7 + USIPE6 + USIPE5 + USIMST + USIOE; // Configure USI: Port and Master
USICTL1 |= USIIE; // Counter interrupt enabled, flag remains set
USICKCTL = USIDIV_5 + USISSEL_2 + USICKPL; // Configure USI Clock
USICTL0 &= ~USISWRST; // USI released for Operatio
while(1)
{
USISR = 0xDEA3; // write any data to shift Register
USICNT = USI16B; // 16bit communicaton
USICNT |= 16; // set bit Counter to 16
// while (!(USIIFG & USICTL1)); //Counter clear?
}
I set the while in the end to comment line, because otherwise the code stops in this line (what means, that no data is clocked out)