Serial Peripheral Interface: Difference between revisions

Content deleted Content added
Line 139:
 
===Bit-banging the protocol===
The [[pseudocode]] below outlines a software- implementation ("[[bit-banging]]") of SPI's protocol as a main with simultaneous output and input. This pseudocode is for CPHA=0 and CPOL=0, thus SCLK is pulled low before {{Overline|CS}} is activated and bits are inputted on SCLK's rising edge while bits are outputted on SCLK's falling edge.
 
* Initialize SCLK as low and {{Overline|CS}} as high