Problem with MSP430F6723 SPI

We are using MSP430F6723, and we want to achieve 20 uA of current consumption.

There is a problem with hardware SPI.

SMCLK doesn’t stop after reading from SPI is finished.

If I’m not mistaken, it doesn’t stop if UCBUSY = 1.

I don’t care about UCBUSY behavior, but I have huge additional current consumption becasue SMCLK doesn’t stop.

Therefore, I have to use a software implementation of SPI. But in this case I need 160 uSec to read 32-bit word.

With hw SPI it takes 30-40 uSec (4 times faster). It also costs 2 uA additional consumption. This value isn’t small, if we want achieve 20 uA for the whole device.

Furthermore, sometimes everything works fine (SMCLK stops).

In attachement is the source code, which seems work properly (I don’t know why, and how long it will work properly).

If I change to use pull-down instead of pull up - SMCLK doesn’t stop again.

What is the reason of such strange behaviour and how to fix it ?
tdc_hspi.c (6.87 KB)
tdc_spi.h (1.57 KB)