K64F DSPI Clock Glitch (KSDK SPI Master Driver)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K64F DSPI Clock Glitch (KSDK SPI Master Driver)

990 Views
JonSzymaniak
Contributor II

Hi there,

 

I'm just looking to test out some simple DSPI Master transfers (non-DMA operation) on the FRDM-K64F using the KSDK (1.0.0) Master peripheral driver.


The API seems pretty straight-forward.  However, with in each byte in my transfers, there's a glitch between bit 0 and bit 7 of the following byte:

 

16866_16866.pngK64F_SPI_xfer.png

 

This only appears to happen for the kDspiClockPhase_FirstEdge clock phase option.

 

I was just curious if anyone else has run into this. The code's attached.


Cheers,

Jon

Original Attachment has been moved to: main.c.zip

Labels (1)
Tags (3)
2 Replies

524 Views
JonSzymaniak
Contributor II

A colleague of mine kindly pointed out that I have overlooked the DSPI_DRV_MasterSetDelay() API function.  Using this with the kDspiAfterTransfer option) has allowed me to introduce time between successive words within a transfer.

I'll have to take a look at the datasheet and the peripheral driver to understand why I needed to do this for kDspiClockPhase_FirstEdge, but not kDspiClockPhase_SecondEdge....will try to report back here, if anyone is interested.

Just as another minor note -- I see the data is idling high, hence that momentary spike between data byte 0 and data byte 1 in my previous screenshot.

- Jon

524 Views
codylundie
Contributor II

I am experiencing the same behavior under the same conditions. Was DSPI_DRV_MasterSetDelay() the ultimate fix, or did you uncover anything else?

0 Kudos