GEX thesis source code, full text, references
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.3 KiB

\section{PWM Unit}
The \gls{PWM} unit uses a timer/counter to generate a \gls{PWM} (pulse train) signal. There are four outputs with a common frequency and independent duty cycles. Each channel can be individually enabled or disabled. This unit is intended for applications such as light dimming, heater regulation, or the control of H-bridges.
\subsection{PWM Configuration}
# Default pulse frequency (Hz)
# Pin mapping - 0=disabled
# Channel1 - 1:PA6, 2:PB4, 3:PC6
# Channel2 - 1:PA7, 2:PB5, 3:PC7
# Channel3 - 1:PB0, 2:PC8
# Channel4 - 1:PB1, 2:PC9
\subsection{PWM Commands}
0 & \cname{SET\_FREQUENCY}
Set the PWM frequency
& \begin{cmdreq}
\cfield{u32} frequency in Hz
\end{cmdreq} \\
1 & \cname{SET\_DUTY}
Set the duty cycle of one or more channels
& \begin{cmdreq}
\item Repeat 1--4 times:
\cfield{u8} channel number 0--3
\cfield{u16} duty cycle 0--1000
\end{cmdreq} \\
2 & \cname{STOP}
Stop the hardware timer. Outputs enter low level.
& \\
3 & \cname{START}
Start the hardware timer.
& \\