The simples device for serial communication is a
shift register.
We have module with 74HC595 shift
register. The pins are ground (white wire), Vcc (power supply, black),
serial data (blue), data clock (green) and strobe (yellow). Data
in shift register is shifted on raising edges of data clock.
The register has buffer and data line (connected to LED-s) reflect
content of the buffer. Raising edge on strobe line moves data
from shift register to the output buffer.
-
Example (in Energia environment)
illustating work of shift register. This one just uses
digitalWrite.
-
Example using using libopencm3 and
direct port access.
-
Example using using libopencm3.
We use routine to tranfer bytes (which in turn uses
direct port access).
-
Example transferring data to
shift register using SPI hardware (via Energia libraries).
-
Example using using libopencm3.
To transfer a bytes we use SPI hardware.
-
Example using using libopencm3.
To transfer a bytes we use SPI hardware. Additionally, we
use systick timer and sleep during delays.
Arduino examples
using shiftOut().