AnsweredAssumed Answered

SDK K02, Spi Delay After transfer (Tdt)

Question asked by arnogir on Feb 19, 2020
Latest reply on Feb 24, 2020 by arnogir

Hello,

 

I'm using a k02FN64VLH10.

 

I want use the SPI to transfer 4 bytes to a analog converter. The ChipSelect signal must not be unasserted between theses 4 bytes.

 

Then in McuXpresso SDK configuration for the Spi peripheral, I configured like this:

 

Then the DSPI_MasterSetDelayTimes is called from DSPI_MasterInit with following parameters:

Base : SPI0

WhichCTAR = CTAR0

whichDelay = kDSPI_BetweenTransfer

srcClock_Hz = 49999360

delayTimeInNanoSec = 250.

 

Then At the end of this function, the function DSPI_MasterSetDelayScaler is called with:

prescaler = 3 (= Div/7)

scaler = 0 !!...

 

Then I called the functin to start transfer like this:

 MasterXfer.txData      = Buffer;
  MasterXfer.rxData      = Buffer;
  MasterXfer.dataSize    = NumberRegsisterToRead + 2;
  MasterXfer.configFlags = kDSPI_MasterCtar0 | DV_ADS1248_SPI_PCS | kDSPI_MasterPcsContinuous;  
  DSPI_MasterTransferBlocking(DV_ADS1248_SPI_CHANNEL, &MasterXfer);

 

But on the scope, I get 8 clock pulse, then the following 8 start immediately, there is a very small time (80ns) instead of the configured value (=250ns = 1 clock pulse)...

 

To resolve the problem, I must change the ConfigFlag by remove the kDSPI_MasterPcsContinuous. By this, I have good clock, but the Chip select signal is deaserted between each byte.

 

Then I rout the Chip Select pin to a normal GPIO I forced to 0. But I get a warning into the SDK because PCS0 is not routed...

 

How have a continous ChipSelect with a correct Tdt? I try to change DT to the max (16) and PDT to 3 to have the maximum time without success...

Outcomes