11 years ago.

KL25z SPI Mode 1 Issue

There was a post about this six months ago, but didn't provide an answer to this problem: https://mbed.org/forum/bugs-suggestions/topic/4419/

Has anyone been able to set up an SPI interface with the KL25z in mode 1 (CPOL = 0, CPHA = 1) successfully? I have been trying to interface with the ADS1292 but with no success. I have been able to set up an SPI interface in mode 0, and mode 3, but for some reason mode 1 does not work.

2 Answers

11 years ago.

Have you checked with a scope or logic analyser which waveforms are generated? I saw that topic in the past, and it looked to me like the code is correct. I just ran a simple program with mode 1, and from what I can tell it sets the registers correct. And the KL25s errata sheet says nothing about broken SPI modes, something I assume would fairly quickly get detected.

11 years ago.

I don't have a scope fast enough to detect the waveforms. But from what I could see with my low quality scope was that the KL25z did output a signal with the right polarity, and the chip responded back. I'm assuming it's an issue with the clock phase. I typically get a response that's pure zeros. If I introduce jitter by shaking the board, it gives back miscellaneous numbers.