FRDM-K66 FreeRTOS DSPI Pin-Muxing

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FRDM-K66 FreeRTOS DSPI Pin-Muxing

跳至解决方案
2,497 次查看
jeremyanderson
Contributor III

I've created a project for this example and run it with success, but just for educational purposes I changed the pin muxing to use SPI2 so the jumpering looks like this:

SPI0 pins are connected with SPI1 pins of board
INSTANCE0   (SPI0) CONNECTS TO    INSTANCE1(SPI2)
Pin Name    Board Location    Pin Name Board Location
MOSI          J2 pin 10                MISO        J2 pin 17
MISO          J2 pin 8                  MOSI        J3 pin 9
SCK             J2 pin 12               SCK          J2 pin 19
PCS0          J2 pin 6                  PCS0        J6 pin 3

 

After using the Pin Tool to generate the pinmux files I copied them in to my project and changed:

#define EXAMPLE_DSPI_SLAVE_BASE (SPI1_BASE)
#define EXAMPLE_DSPI_SLAVE_IRQN (SPI1_IRQn)

to:

#define EXAMPLE_DSPI_SLAVE_BASE (SPI2_BASE)
#define EXAMPLE_DSPI_SLAVE_IRQN (SPI2_IRQn)

When I run this example I get an error reported in data transfer.  The master and slave transfers complete successfully, but the data received by the slave is all 1s, whereas the data received by the master matches what was sent by the slave.

 

I'm wondering is this is a problem with the documentation of the board or the pin muxing, or if I don't understand the process.  Anyone else tried this?

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

Original Attachment has been moved to: pin_mux.h.zip

0 项奖励
回复
1 解答
2,308 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Jeremy,

PTB23 is on pin9 of J4, not J3. Please refer to the following for details.

pastedImage_1.png

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

2 回复数
2,308 次查看
jeremyanderson
Contributor III

Yes, that solved my problem and the lesson for me was to not trust the labels in the imported project.  ;-)

0 项奖励
回复
2,309 次查看
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Jeremy,

PTB23 is on pin9 of J4, not J3. Please refer to the following for details.

pastedImage_1.png

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------