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.
已解决! 转到解答。
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
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
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