diff --git a/soc/soc.tex b/soc/soc.tex index 5f81d07..d201652 100644 --- a/soc/soc.tex +++ b/soc/soc.tex @@ -113,7 +113,26 @@ The Arty development board contains an RJ-45 Ethernet jack connected to an Ether \subsection{WS2812 driver} -% TODO +A hardware driver for WS2812 serially-addressable RGB LEDs is also included in the SoC. It was developed independently as part of the curriculum at HTL and later incorporated into the SoC. + +\begin{figure}[h] +\includegraphics[width=\textwidth]{ws2812.png} +\caption{Block diagram of the WS2812 driver} +\end{figure} + +\begin{figure}[h] +\centering\includegraphics[width=0.5\textwidth]{ws2812_timing.png} +\caption{Timing diagram for the WS2812 serial protocol} +\label{fig:ws2812_timing} +\end{figure} + +The driver is designed to be attached to external circuitry that provides color data for any given LED index (address). This can either be discrete logic that generates the color value from the address directly, or a memory that stores a separate color value for each address. + +The LEDs are controlled using a simple one-wire serial protocol. After a reset (long period of logic 0), the data for all LEDs is transmitted serially in one single blob. Each LED consumes and stores the first 24 bits of the stream and applies them as its color value (8 bits each for red, green, blue), all following bits are passed through unmodified. The second LED thus uses the first 24 bits of the stream it receives, but since the first LED already dropped its data, these are actually the second set of 24 bits of the source data. + +Every bit is encoded as a period of logic 1, followed by a period of logic 0. The timing of these sections determines the value, see \ref{fig:ws2812_timing}. + +The exact timing differs between models, so all periods can be customized using generics in the VHDL entity. \subsection{DRAM} diff --git a/soc/ws2812.drawio b/soc/ws2812.drawio new file mode 100644 index 0000000..bc0b83b --- /dev/null +++ b/soc/ws2812.drawio @@ -0,0 +1 @@ +7VrbktsoEP0aP2ZKgNDlMWPPJqlKNqn1biV5ZCQskcjCK6Gxna9fZIF1wZ4465FlufLiggbacJrTdIMmaLrcvMnIKv7AQ5pMoBVuJmg2gdC3XPlbCraVANuwEkQZCysRqAVz9oMqoaWkBQtp3uooOE8EW7WFAU9TGoiWjGQZX7e7LXjS/tcViaghmAckMaWfWShiJXUsq254S1kUC71g1bAkurMS5DEJ+bohQg8TNM04F1VpuZnSpMRO41KN++NI635iGU3FKQM+vYl8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ab59UaDN29+sSEePM+pkRsAxw7zLZkZmlJdREm7Hj7TXvrgCeocP5aWxma4YIPeQp6Q8pS+EaCei8A5kKIduXPffl/8CpLJaf61dhST1J+/o4T8= \ No newline at end of file diff --git a/soc/ws2812.png b/soc/ws2812.png new file mode 100644 index 0000000..0c309a6 Binary files /dev/null and b/soc/ws2812.png differ diff --git a/soc/ws2812_timing.png b/soc/ws2812_timing.png new file mode 100644 index 0000000..728d9d4 Binary files /dev/null and b/soc/ws2812_timing.png differ