| 
    Stepper-Motor-Control
    v3.0.0
    
   System on a Chip 2014 - Group 04 
   | 
 
Entity of testbench for motor_control_unit. More...

Libraries | |
| ieee | |
| Use Standard Library.  | |
Use Clauses | |
| STD_LOGIC_1164 | |
| Use Logic Elements.  | |
| STD_LOGIC_arith | |
| Use Arithmetic Functions.  | |
| STD_LOGIC_SIGNED | |
| Use Conversion Functions.  | |
Generics | |
| divider | integer := 125 | 
| Prescaler for PWM-signal.   | |
Entity of testbench for motor_control_unit.
Definition at line 43 of file motor_control_unit_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 66 of file motor_control_unit_tb.vhd.