K22F DSPI Success from PEx

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

K22F DSPI Success from PEx

1,578 Views
tharonhall
Contributor IV

I have some "sort of" working code for the K22F generated from PEx. There is an unusually LONG gap between byte transmissions, even though I add a very short delay to allow the transmission to go in the event of a non-blocking SPI transfer, or even if I just call back-to-back blocking SPI transfers. I noticed that the API has calls to set up various timing parameters that I don't see in PEx, which makes we wonder if some hand manipulation is necessary.

Has anyone had success with the DSPI driver with the K22F from PEx? Is it possible that it is not fully supported? Should I just set everything up by hand?

If anyone could point to some good, working example code, either PEx or non-PEx, it would be greatly appreciated. I am terribly behind on my progress and in trouble at this point. My biggest problem is time and other competing projects.

Thanks!

Labels (1)
Tags (5)
5 Replies

897 Views
tharonhall
Contributor IV

OK, so after much hair pulling, I was able to discover the source of the issue. I am not quite sure why it did this, but the SDK SPI was reconfiguring the SPI bus with every SPI transfer, and this evidently created a rather long delay. I made my own local copy of the code and made sure it was only done on the first transfer and things are now humming along.

I will try and post more details as I have a chance.

0 Kudos
Reply

897 Views
dereksnell
NXP Employee
NXP Employee

Hi Tharon,

Here is a post with a KSDK SPI example. It does not use PEx, but you can use it as a reference for the KSDK SPI drivers. PEx uses the same KSDK drivers with the fsl_dspi component.

https://community.freescale.com/docs/DOC-103944?et=watches.email.document

Thanks

897 Views
tharonhall
Contributor IV

Bump? Help?

0 Kudos
Reply

897 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Tharon Hall:

Are you using SPIMaster_LDD (classic PEx) or fsl_dspi (KSDK) component?

There are some helpful examples and discussions in the community for both cases:

Is anyone really using PE Generated SPI driver with MQXLite? How? <- Discussion about PEx SPI driver code

SPI with FRDM K22F     <- Example SPI PEx project provided by colleague Li Yong

KSDK SPI Master-Slave with FRDM-K64F     <- SPI Master - Slave with KSDK and KDS

Regards!

Jorge Gonzalez

897 Views
mjbcswitzerland
Specialist V

Tharon

Beware that SPI0 and SPI1 are not the same in the K22.

SPI0 has 4 deep FIFO and so is compatible with DSPI

SPI1 has 1 deep FIFO and so requires different handling.

If you use SPI0 there shouldn't be any difficulties but possibly the automated tools don't know the SPI1 limitation yet (?) SPI is however very simple so there is little point in not doing it yourself with a couple of lines of code.

Regards

Mark

Kinetis: µTasker Kinetis support

K22: µTasker Kinetis FRDM-K22F support / µTasker Kinetis TWR-K22F120M support

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