Stepper-Motor-Control
v3.0.0
System on a Chip 2014 - Group 04
|
Testbench entity. More...
Libraries | |
ieee | |
Use Standard Library. |
Use Clauses | |
std_logic_1164 | |
Use Logic Elements. |
Generics | |
divider | INTEGER := 125 |
Prescaler for PWM-signal. |
Testbench entity.
Definition at line 25 of file counter_tb.vhd.
|
Generic |
Prescaler for PWM-signal.
For this purpose 2,5 ms are used as minimal pulse-width.
The prescaler is calculated with the given and desired frequency via the following formula:
\begin{equation*} \text{prescaler} = \frac{f_{\text{clock}} \text{Hz}}{f_{\text{prescaler}} \text{Hz}} \end{equation*}
e.g.:
\begin{equation*} \left.\begin{aligned} f_{\text{prescaler}} &= \frac{5}{2}\,\text{ms} \newline &= 400\,\text{Hz} \newline\newline \text{prescaler} &= \frac{50\,\text{Mhz}}{400\,\text{Hz}} \newline &= 125000 \newline \end{aligned} \right\} \qquad \text{pulse-width: 2.5 ms} \end{equation*}
For simulation-purpose the divider was set to 125 for faster wave generation.
Definition at line 48 of file counter_tb.vhd.