"SPI_POPR" always 0

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

"SPI_POPR" always 0

Jump to solution
873 Views
Fan_xy
Contributor III

Hello

I use TWR-K60D100M   spi0 is master , spi1 is slave ,  sip0 send "3" to spi1 ,  In the scope I can see the correct signal and clk singnal .

And I also can see the transfer count register " SPI1_TCR" work increase ,

And in the spi1 , I can see the spi1_sr_tcf  setting to 1, also spi1 can enter the receiving interrupt .

While in the FIFO register "SPI1_POPR" is always 0.  I don.t know why ?

2.png

3.png

4.png

Thank you !

Linda

Labels (1)
0 Kudos
1 Solution
637 Views
santiago_lopez
NXP Employee
NXP Employee

Hi Linda,

Which Reference Manual are you consulting? The TWR-K60D100M uses the part number MK60DN512VMD100. The Reference Manual for this microcontroller can be found in this link: http://cache.freescale.com/files/32bit/doc/ref_manual/K60P144M100SF2V2RM.pdf?fasp=1&WT_TYPE=Referenc...

Here, in chapter 10 you can see that the SPI pins can be configured to be either SIN or SOUT depending on your needs

spi_pins_k60.png

Take a look at it. Configure your pin muxing to Alt 2 or 7 depending on your connections and let us know how it went.

Regards

Santiago Lopez

Applications Engineer -- Medical Segment

View solution in original post

0 Kudos
7 Replies
637 Views
santiago_lopez
NXP Employee
NXP Employee

Hi Linda,

Did you check the pin muxing for the pin you are using for SPI1 SIN? Check the PORTx_PCRn register to make sure that the PORT_PCR_MUX bit field is configured properly (check Reference Manual Chapter 10.3.1 for pin muxing information)

Also please check that you have connected the Master SIN, SOUT pins to the correct SIN,SOUT pins in the slave according with the diagram on reference manual chapter 50.4

SPI diagram.PNG.png

Saludos

0 Kudos
637 Views
Fan_xy
Contributor III

Hi Saludos

Thank ! You are right , I the PTE3 is the SPI1_IN.   I config the SPI pin refer to the board sch , I haven't see the chapter 50.4 .

So,  now I confused about the reference manual 50.4 and the SCH of TWR-K60D10M , they are inconsistent in my understanding . pleas help me again , thank you !

11.png

22.png

Linda

0 Kudos
638 Views
santiago_lopez
NXP Employee
NXP Employee

Hi Linda,

Which Reference Manual are you consulting? The TWR-K60D100M uses the part number MK60DN512VMD100. The Reference Manual for this microcontroller can be found in this link: http://cache.freescale.com/files/32bit/doc/ref_manual/K60P144M100SF2V2RM.pdf?fasp=1&WT_TYPE=Referenc...

Here, in chapter 10 you can see that the SPI pins can be configured to be either SIN or SOUT depending on your needs

spi_pins_k60.png

Take a look at it. Configure your pin muxing to Alt 2 or 7 depending on your connections and let us know how it went.

Regards

Santiago Lopez

Applications Engineer -- Medical Segment

0 Kudos
637 Views
Fan_xy
Contributor III

Hi Santiago,

I use the older RM Rev.6.Nov 2011 .  OK , I use the new one .

Now ,My projec can work normal refer to your suggestion, thank you !

While ,I  still have some confused about the SCH of TWR-K60D100M ,  for example ,

44.png

the pin PTD13 is SPI2 MOSI ,it is mean  if SPI2 is master , PTD13 is out pin , if  slave , ptd13 is in  .  while from the sch,  this pin only can used to SOUT  , is this mean  spi2 only can used to master ?

Or I misunderstand somothing?  please tell me  .

Thank

Linda

0 Kudos
637 Views
adriancano
NXP Employee
NXP Employee

Hi Linda,

As my colleague Santiago mentioned you need to check always you are connecting the correct SPIx_SIN (MISO) pin on the master side to the SPIx_SOUT (MOSI) pin on the slave side and also the SPIx_SOUT (MOSI) pin on the master side to the SPIx_SIN (MISO) pin on the slave side. In the image below you can see a configuration example that show SPI2 as master and as slave.

spi.png

I hope this information can help you.

Regards,

Adrian

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos
637 Views
Fan_xy
Contributor III

Hello,

I know your meaning , I know the meaning of MISO  and the MOSI , I also know the  image you give me .

My qustion is the  SCH of TWR-K60D100M (from freescale ) .  According to the truth , SPI 2 can as MASTER  ,also can as slave , while from the SCH,  whether said  the spi2 only can as master on the TWR-K60D100M board ?

Linda

0 Kudos
637 Views
adriancano
NXP Employee
NXP Employee

Hi,

Sorry, I misunderstood your question. I see where the confusion is.

The SPI2 can be used as master or as slave as I indicated in my last response. But, when a device is connected on the TWRPI connector the PTD13 is the SPI2_MOSI that is why you can see in the label SPI2_MOSI. The label there is for the TWRPI connection that you can see in the schematic.

twrpi.jpg

In conclusion if you connect a Slave device on the TWRPI connector the SPI2 just can be MASTER but if you are using the PTA13 pin in your own hardware connections SPI2 can operate as Salve or as a Master.

I hope this information can help you.

Regards,

Adrian

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. It would be nice!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos