Hi
I have connected two slaves to my k22f board in daisy chain fashion
SCK-- 20MHz
bus clock 40 Mhz
core clock 40Mhz
SPI interrupt mode
case1:
Each slave will take 32 bits of data. So i am sending total 64 bits of data in total for two slaves. So for 20Mhz clock, 8 bytes of data should take 3.2 us( say 4 to 5 us considering other delays). But i am getting a strange delay after each byte of communication. -[400ns for each byte + some 16us delay] *8 times.
I am using inbuilt Kinteis FSL_DSPI_MASTER_DRIVER driver.
When tried with SPI 1, [where it has got 1 FIFO buffer]
dspi_master_user_config_t masterUserConfig = {
.isChipSelectContinuous = true,
.isSckContinuous = false,
.pcsPolarity = kDspiPcs_ActiveLow,
.whichCtar = kDspiCtar1,
.whichPcs = kDspiPcs0
};
masterDevice.dataBusConfig.bitsPerFrame = 8;
masterDevice.dataBusConfig.clkPhase = kDspiClockPhase_FirstEdge; // CPOL = 0 and CPHA = 0
masterDevice.dataBusConfig.clkPolarity = kDspiClockPolarity_ActiveHigh;
masterDevice.dataBusConfig.direction = kDspiMsbFirst;
case2:
For SPI 1, with masterDevice.dataBusConfig.bitsPerFrame = 16, it is not working.
Even though the delay has reduced to 10us (which is not acceptable for my requirement), slaves also not responding.
dspi_master_user_config_t masterUserConfig = {
.isChipSelectContinuous = true,
.isSckContinuous = false,
.pcsPolarity = kDspiPcs_ActiveLow,
.whichCtar = kDspiCtar1,
.whichPcs = kDspiPcs0
};
masterDevice.dataBusConfig.bitsPerFrame = 16;
masterDevice.dataBusConfig.clkPhase = kDspiClockPhase_FirstEdge; // CPOL = 0 and CPHA = 0
masterDevice.dataBusConfig.clkPolarity = kDspiClockPolarity_ActiveHigh;
masterDevice.dataBusConfig.direction = kDspiMsbFirst;
case3:
For SPI 0, [ 4 FIFO]
SCK-- 20MHz
bus clock 60 Mhz
core clock 60 Mhz
dspi_master_user_config_t masterUserConfig = {
.isChipSelectContinuous = true,
.isSckContinuous = false,
.pcsPolarity = kDspiPcs_ActiveLow,
.whichCtar = kDspiCtar1,
.whichPcs = kDspiPcs1
};
masterDevice.dataBusConfig.bitsPerFrame = 16;
masterDevice.dataBusConfig.clkPhase = kDspiClockPhase_FirstEdge; // CPOL = 0 and CPHA = 0
masterDevice.dataBusConfig.clkPolarity = kDspiClockPolarity_ActiveHigh;
masterDevice.dataBusConfig.direction = kDspiMsbFirst;
In this case, for 64 bit data when i checked in scope, it is getting around 4us.
BUT Not working for me when i connected slaves.
So case 1 is working for me( but with huge delay in between each byte). ideally case 3 should work[ as i can see in scope, 4us for all 64 bit transmission] but it is not working for me when connected salves in daisy chain.
Can you please help me in finding a possible solution to communicate using daisy chain for 64 bit transmission at 20Mhz clock (operation within 4us).