How to configure spi registers of TWR-K65F180M in MQX

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

How to configure spi registers of TWR-K65F180M in MQX

900 次查看
swathit
Contributor I

Hi...Iam working on lcd interfacing with TWR-K65F180M using spi1. I have an issue in making my chipselect active high during data transfer and I cant make changes in the MCR, CTAR, SR registers using inbuilt functions namely ioctl(spifd, IO_IOCTL_SPI_SET_BAUD, &param),ioctl (spifd, IO_IOCTL_SPI_GET_FRAMESIZE, &param),etc which were given in example code of spi.

I changed " #define BSP_SPI_MEMORY_CHANNEL" to 1 &  "const SPI_INIT_STRUCT _bsp_spi1_init " framsize = 7, baudrate = 8330000, chipselect = 1 in init_spi.c...Though the realterm is printing framsize, baudrate correctly using   IO_IOCTL_SPI_GET_BAUD, IO_IOCTL_SPI_GET_FRAMESIZE..my framesize is not set in ctar FMSZ register.what else should be changed to set FMSZ, BR, PBR, DIS_RXF, DIS_TXF and also make chipselect active high during data transmission?

标记 (3)
0 项奖励
回复
1 回复

681 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Swathi:

Do you still have this issue? I did a quick check with your modifications , I found the registers changed. Please see the following picture.

pastedImage_1.png

The real register setting is within the following function

meory_read_status(spifd);

Regards

Daniel

0 项奖励
回复