Hi,
I need a chip select output so that I can sync the SPI data stream with a MCP4922 DAC. The KE06Z seems to support a slave select output but I cannot make it work.
I am using the fsl_spi interface, and it turns out all the default master configuration is compatible with the DAC:
void SPI_MasterGetDefaultConfig(spi_master_config_t *config)
{
/* Initializes the configure structure to zero. */
memset(config, 0, sizeof(*config));
config->enableMaster = true;
config->enableStopInWaitMode = false;
config->polarity = kSPI_ClockPolarityActiveHigh;
config->phase = kSPI_ClockPhaseFirstEdge;
config->direction = kSPI_MsbFirst;
#if defined(FSL_FEATURE_SPI_16BIT_TRANSFERS) && FSL_FEATURE_SPI_16BIT_TRANSFERS
config->dataMode = kSPI_8BitMode;
#endif /* FSL_FEATURE_SPI_16BIT_TRANSFERS */
#if defined(FSL_FEATURE_SPI_HAS_FIFO) && FSL_FEATURE_SPI_HAS_FIFO
config->txWatermark = kSPI_TxFifoOneHalfEmpty;
config->rxWatermark = kSPI_RxFifoOneHalfFull;
#endif /* FSL_FEATURE_SPI_HAS_FIFO */
config->pinMode = kSPI_PinModeNormal;
config->outputMode = kSPI_SlaveSelectAutomaticOutput;
config->baudRate_Bps = 500000U;
}
I enabled the pin (PTE3) as a GPIO, not sure if this is correct, but I do not see any other way to route it.
My init in main() is:
SPI_MasterGetDefaultConfig(&masterConfig);
SPI_MasterInit(SPI_MASTER, &masterConfig, CLOCK_GetFreq(kCLOCK_BusClk));
While running my SPI output cycles (2 bytes using SPI_WriteBlocking()), I see clock and data but no signal on PTE3.
An I expected to manipulate MODFEN and SSOE directly? Very confused.