Other Parts Discussed in Thread: MSP430F2012
Hi
I am trying to understand how the spi buffer works between reading and writing. How does the msp430 distinguish between read and write operations when using the spi mode. There is a common register USISRL for both read and write buffering. So if I want to read a byte then I do
USICTL0 &= ~USIIFG; // Clear the interrupt flag
USICNT = 0x08;
while(USIIFG & USICTL0 != 0x01);
and to write I do
USICTL0 &= ~USIIFG; // Clear the interrupt flag
USISRL = 0xAB; //Where 0xAB is the data to be TXed.
USICNT = 0x08;
while(USIIFG & USICTL0 != 0x01);
What happens to the contents of the USISRL register ? Does it clock in a bit into the register for every bit it clocks out ?
Thank You