kinetis spi driver, artificially hold the spi line low (to wake the device before communication)

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

kinetis spi driver, artificially hold the spi line low (to wake the device before communication)

Jump to solution
811 Views
budarriola
Contributor I

When using the kinetis spi driver and processor expert is there a way to artificially hold the spi line low (to wake the device before communication). I am using a mkl27

0 Kudos
1 Solution
620 Views
mjbcswitzerland
Specialist V

Bud

The KL27 has DMA, which can be triggered by the SPI flags.

However the SPI is double-buffered so as long as you keep the buffer full you shouldn't have any gaps between bytes in a sequence.

That is, fill the next byte to be sent when the TX buffer full flag is not set and read out the received data on the RX buffer not empty flag - don't do the Tx on the Rx buffer empty flag otherwise there may be a gap due to the internal synchronisation (which is probably always there on the start byte).

Regards

Mark

View solution in original post

0 Kudos
4 Replies
620 Views
mjbcswitzerland
Specialist V

Bud

Unlike the SPI in the K family, the one in the KLs has very little chip select control in master mode.

It is probably easiest to use the pin in GPIO mode, negate it and program a delay (eg. using timer and interrupt) before starting the SPI transmission.

Regards

Mark

Kinetis: http://www.utasker.com/kinetis.html

KL27: http://www.utasker.com/kinetis/FRDM-KL27Z.html / http://www.utasker.com/kinetis/Capuccino-KL27/Capuccino-KL27.html

For the complete "out-of-the-box" Kinetis experience and faster time to market

:smileyinfo: Out-of-the-box support for 47 Kinetis boards and 10 IDEs (460 combinations from a single code source with no porting required)

0 Kudos
620 Views
budarriola
Contributor I

I was hoping that was not the case as there is a 4.26us delay after the cs goes low and the first spi clock and a 11.52us delay after the last spi clock before the cs returns high (12Mbit/s). i do however see the same 4.26us delay between bytes. this chip does not seem to have dma, is there any way to speed this up?LeCroy1.jpgLeCroy.jpg

0 Kudos
621 Views
mjbcswitzerland
Specialist V

Bud

The KL27 has DMA, which can be triggered by the SPI flags.

However the SPI is double-buffered so as long as you keep the buffer full you shouldn't have any gaps between bytes in a sequence.

That is, fill the next byte to be sent when the TX buffer full flag is not set and read out the received data on the RX buffer not empty flag - don't do the Tx on the Rx buffer empty flag otherwise there may be a gap due to the internal synchronisation (which is probably always there on the start byte).

Regards

Mark

0 Kudos
620 Views
budarriola
Contributor I

thank you

0 Kudos