What are these four wires like? 这四根线像什么?
SPISPI
the most common four-wire hookup between two chips. The wire that says start also names which chip — hence chip-select.
两块芯片之间最常见的四线接法。喊开始的那根还要点名是哪一块,所以叫片选。
It's like…就像……
One person taps a beat; the other listens only on the beat. Nobody agrees on speed beforehand — the tapper just stays under what the listener can follow. 一个人打拍子,另一个人只在拍子上听。两个人不用先商量快慢——只要别快过对方跟得上的速度。
The clock is that beat 时钟就是那个拍子
模式 0(CPOL=0、CPHA=0)mode 0 (CPOL=0, CPHA=0)
SPI's most used clock mode. The clock idles low. A bit is read on the rising edge (low to high) — a datasheet calls that moment the sample. The next bit appears on the falling edge.
SPI 四种时钟模式里最常用的一种。时钟闲着是低的。上升沿(从低跳到高)读走一位,手册把这一下叫采样。下降沿(从高跳到低)换下一位。
The clock is one wire swinging between high and low; one swing is one beat. 时钟就是一根线在高低之间来回,来回一趟算一拍。
One byte, eight beats 一个字节,8 拍走完
一位 / 一个字节one bit / one byte
high or low only: a beat carries one 0 or 1 — a bit. Eight bits make a byte, top bit b7 first down to b0.
线上只有高低两档,一拍只送一个 0 或 1,这就是一位。8 位是一个字节,图上从最高位 b7 先走到 b0。
Why the data has to settle early 为什么数据要提前稳住
建立 / 保持时间setup / hold time
how long the data must be steady before the sampling edge (setup). How long it must stay put after it (hold).
采样那一下之前,数据要先稳住多久(建立)。采完之后,还要再撑住多久(保持)。
The data must settle before the sampling edge, and hold still after it. 数据要在采样那一下之前就稳住,采完还得再撑一会儿。
One transfer, three moments 一次传输,三个时刻
1
CS drops, first bit ready 片选拉低,摆好首位
2
Eight rising edges, a bit each 8 个上升沿各取一位
3