Hi Alice,
I am not using the MCUXpressoIDE, instead, I am using CLion, and in that case, I am not able to view the registers using PyOCD. I had raised a community post on it and was basically asked to use the MCUXpressoIDE. So i can not confirm it using register view, however using the confid tools, i am setting the CPOL to 0 and seeing the same in pheripherals.c
const spi_master_config_t FLEXCOMM8_config = {
.enableLoopback = false,
.enableMaster = true,
.polarity = kSPI_ClockPolarityActiveHigh,
.phase = kSPI_ClockPhaseFirstEdge,
.direction = kSPI_MsbFirst,
.baudRate_Bps = 1000000UL,
.dataWidth = kSPI_Data8Bits,
.sselNum = kSPI_Ssel0,
.sselPol = kSPI_SpolActiveAllLow,
.txWatermark = kSPI_TxFifo0,
.rxWatermark = kSPI_RxFifo1,
.delayConfig = {
.preDelay = 0U,
.postDelay = 0U,
.frameDelay = 0U,
.transferDelay = 0U
}
};
static void FLEXCOMM8_init(void) {
/* Initialization function */
SPI_MasterInit(FLEXCOMM8_PERIPHERAL, &FLEXCOMM8_config, FLEXCOMM8_CLOCK_SOURCE);
}I had used a sample program similar to the SPI example and found the same behaviour
Now if i change the CPOL to 1, the behavior is as required. SPI clock and MOSI outputs default to low. This means that i cannot use CPOL=0 for interfacing with the system I am using. Is there any way to reverse this behaviour for CPOL=0?
Regards,
Joseph