Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years, 5 months ago.
mbed SPI mode
Hi all, i've got a question about mbed SPI driver: if i change the peripheral working mode from to 0 to 2-3 (CPOL 1), the SCK pin shouldn't go high?
Thanks in advance.
1 Answer
8 years, 5 months ago.
The CPOL polarity defines the SCK level during idle periods: either high or low.
See here.
When you change the mode the pins should activate the new mode immediately.
Apparently there's something wrong.
I create a SPI object, change mode to 3 and write a cmd.
This is what i see on the bus SCK stays high only after the first write.
I'm on frdm-k22f.
posted by 14 Jul 2016What value was actually written out? if the value was 0x80 then those waveforms would make sense. I would guess that the clock is "lazy" meaning it only updates when a transition is required and we're not seeing the initial falling edge at t=-0.5bit because the clock was already low.
posted by 14 Jul 2016