Problems of SPI in K60

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

Problems of SPI in K60

Jump to solution
1,998 Views
mdrasool_yadwad
Contributor II

Hello,

     I am using SPI protocol for interfacing with the external ram 23LCV1024 with the K60 microcontroller. I am not using the Fifos directly writing the data on to the push register. K60 as the master mode with 12.5 Mhz baud and 8 bit frame . While writing on to the 23LCV1024 it is working correctly but while reading it is not giving the correct written values. I am not getting what is the problem with it can anyone please help me in this. My code is attached with this.

Labels (1)
0 Kudos
1 Solution
1,844 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

In your code, you set PCS as bellow,

     SPI->PUSHR=SPI_PUSHR_PCS(0x03)....;

Do you mean you want to set 2 PCS line simultaneously? I guess you may want to set PCS3. That should be SPI_PUSHR_PCS(1<<3).

Regards,

Jing

View solution in original post

0 Kudos
5 Replies
1,845 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

In your code, you set PCS as bellow,

     SPI->PUSHR=SPI_PUSHR_PCS(0x03)....;

Do you mean you want to set 2 PCS line simultaneously? I guess you may want to set PCS3. That should be SPI_PUSHR_PCS(1<<3).

Regards,

Jing

0 Kudos
1,844 Views
mdrasool_yadwad
Contributor II

Hello Jing Pan,

   Can you please explain to set that peripherals, as SPI0 is using 6 bits for setting the peripheral. 

Regards,

   Mohammedrasool 

0 Kudos
1,844 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi,

Each bit in PUSHR.PCS represent a CSx signal. You can see in the enum definition in fsl_dspi.h

typedef enum _dspi_which_pcs_config
{
    kDSPI_Pcs0 = 1U << 0, /*!< Pcs[0] */
    kDSPI_Pcs1 = 1U << 1, /*!< Pcs[1] */
    kDSPI_Pcs2 = 1U << 2, /*!< Pcs[2] */
    kDSPI_Pcs3 = 1U << 3, /*!< Pcs[3] */
    kDSPI_Pcs4 = 1U << 4, /*!< Pcs[4] */
    kDSPI_Pcs5 = 1U << 5  /*!< Pcs[5] */
} dspi_which_pcs_t;

Regards,

Jing

0 Kudos
1,812 Views
mdrasool_yadwad
Contributor II

Hello Sir,

I attached document please check it once. In SPI0 the document of tower board is showing chip select 4 as Output. What does it mean we cant able to write or read 

0 Kudos
1,844 Views
mdrasool_yadwad
Contributor II

Hello Jing Pan,

   Thank you for this. I will check once again with this changes and will check whether spi is working or not.

Regards,

Mohammedrasool

0 Kudos