3.8.1 Synopsis
After a picture has been taken, the film is transported forward automatically. In order to detect malfunction, e.g. end of film or a torn film, a transport supervision module needs to be implemented. If the servo motor has not finished the film transport after 2 seconds, an error signal is generated.
The timeout function is generated with the help of a counter. As the clock frequency is 8192 Hz, 2 seconds correspond to a maximum value of 16383 (=14 bit). The CLK and RESET signals are needed for the Flip-Flops again.
The start of the film transport is signaled via the MOTOR_GO signal. It is set to '1' when the transportation begins. When the servo motor has finished, the MOTOR_READY signal is set to '1'. An error is reported via the MOTOR_ERROR signal in the same way, i.e. it is set to '1' if the MOTOR_READY pulse has not occurred in time. The signals are active for the duration of one clock period, only, in order to make an edge detection dispensable.
The interface of the module is depicted in the next drawing:
The transport timeout supervision module
|
-
Behaviour:
-
Usually, the reset strategy is defined for the complete design. As an asynchronous reset was used in the first clocked module, we have to use the same template for clocked processes as before.
-
The timeout counter is started whenever a '1' is detected on the MOTOR_GO signal. The counter is stopped either if the MOTOR_READY signal is set to '1' or if the counter reaches its maximum value. In the last case, the MOTOR_ERROR is set to '1' for one clock cycle.
-
Data types:
-
The module processes and generates control signals, only. They are of type
std_ulogic
, as usual. The counter is most easily implemented by a counter variable of type
integer
.
-
To do:
-
Create a new VHDL file for the MOTOR_TIMER module.
-
Write a testbench to verify the design. The clock period is approx. 122.07 us, in case you want to use realistic time values for the stimuli generation.
-
Compile and simulate the design.
-
How many Flip Flops are generated? Synthesize the design and compare your answer with the synthesis result.