Hello.
I am testing a MSP430FR4133 chip with SPI.
Clock freqs MCLK and SMCLK is 8MHz and ACLK is 32.768 KHz (all tested)
SPI init code is below;
GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_P1,
GPIO_PIN0 + GPIO_PIN1 + GPIO_PIN2,
GPIO_PRIMARY_MODULE_FUNCTION
);
//Initialize Master
EUSCI_A_SPI_initMasterParam param = {0};
param.selectClockSource = EUSCI_A_SPI_CLOCKSOURCE_SMCLK;
param.clockSourceFrequency = 8000000;
param.desiredSpiClock = param.clockSourceFrequency / 4;
param.msbFirst = EUSCI_A_SPI_MSB_FIRST;
param.clockPhase = EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT;
param.clockPolarity = EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_HIGH;
param.spiMode = EUSCI_A_SPI_3PIN;
EUSCI_A_SPI_initMaster(EUSCI_A0_BASE, ¶m);
//Enable SPI module
EUSCI_A_SPI_enable(EUSCI_A0_BASE);
and code in main is;
for(;;)
{
while (!EUSCI_A_SPI_getInterruptStatus(EUSCI_A0_BASE, EUSCI_A_SPI_TRANSMIT_INTERRUPT));
EUSCI_A_SPI_transmitData(EUSCI_A0_BASE, 0xAA);
_delay_cycles(8000000); //1 sec interval
}
In this case, SPI works good (I measured SCK and MOSI line with logic analyzer)
But when I changed code below;
param.clockPolarity = EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW;
there is no any signal on SCK and MOSI...
There is a bug for MSP430FR4133? Why SPI does not work with clock polarity 0?