KE02Z and LT768 SPI communication problem

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

KE02Z and LT768 SPI communication problem

701 次查看
Wartran
Contributor I

Hi everybody,

I'm using FRDM-KE02Z40M to interface with LT7680 (https://www.levetop.cn/uploadfiles/2023/05/LT768x_DS_V42_ENG.pdf) via 4-wire SPI.
I'm using the SPI driver from SDK 2.15 and I'm able to communicate it. Kinda.

As a test I'm writing to a register and reading back from it.

I chose register 0x0F, because it seems like because any value I write to it is valid.
I would write 0xC3 to it and read back 0xC3. So far so good.

Screenshot 2024-06-11 at 00.15.43.png

If I try however to write 0x08, I read back 0x0F. In fact, any value with alternating bits (010) would not be read correctly.

Screenshot 2024-06-11 at 00.18.11.png

It seems I have SPI Mode set correctly. Reducing the speed does not help.
The waveform looks good and matches what I observe in the software.

I'm quite sure the problem is not with the MCU or the driver, but as I'm getting desperate I'd appreciate any help or ideas to troubleshoot this.

I'm happy to provide more details if needed. Thanks in advance!

0 项奖励
回复
4 回复数

637 次查看
Wartran
Contributor I

Dear @xiangjun_rong 

Sorry if I wasn't clear. I don't connect MISO and MOSI together but rather follow the lt7680 datasheet (referenced in the original message)

Write Register’s Address:

  1. Host drive SCS#(Low) and SCLK.
  2. Host drive A0(Low), then drive RW#(Low).
  3. Host drive the Register’s Address (b0 ~ b7) at 9 th ~ 16th Clock to LT768x.

Write Data to Register or Memory:

  1. Host drive SCS#(Low) and SCLK.
  2. Host drive A0(High), then drive RW#(Low).
  3. Host drive the Data at 9 th ~ 16th Clock to LT768x. i.e. Data will be stored in Register or Memory

Read Register’s Data:

  1. Host drives SCS#(Low) and SCLK.
  2. Host drives A0(High), then drives RW#(High).
  3. LT768x will drive the Data of Register at 9 th ~ 16th Clock. Then Host will get the content of Register.

 

0 项奖励
回复

607 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

do you use SPI interface or the other interface?

BR

XiangJun Rong

0 项奖励
回复

589 次查看
Wartran
Contributor I

Hi,

I use 4-wire SPI

0 项奖励
回复

665 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I do not know how you read back the data you have written. Do you connect MOSI and MISO together? in the case, I suppose that the data the SPI master transmitted is the same as that  the SPI master received.

Pls have a check

BR

XiangJun Rong

 

0 项奖励
回复