Hello,
I have a incomprehensible problem when I using SPI in 8 bits transfert on Launchpad with G2231:
When I write 8 in USICNT register to send data, 11 or 12 SCK clock are sent!
I followed the datasheet to configure my device, what have I missed?
I configure the device like this:
USICTL0 |= USIPE5 + USIPE6 + USIPE7 + USIMST + USIOE; // 3-pin, 8-bit SPI master USICTL1 |= USIIE; // Counter interrupt, flag remains set USICKCTL = USIDIV_2 + USISSEL_2; USICTL0 &= ~USISWRST; // USI released for operation
and this is how I send data:
USISR = data_to_send; USICNT = 0x08; //init the counter to shift data while(USICNT != 0 );
Thank you for help