Debounce block appearance in a Simulink model,
Debounce block mask overview,
Name |
Type |
Range |
|||||||||
Input Signal |
|
Expected values 0 or 1 |
Name |
Type |
Range |
Debounce |
Boolean |
Expected values 0 or 1 |
SP (Rising) |
Boolean |
Expected values 0 or 1 |
SP (Falling) |
Boolean |
Expected values 0 or 1 |
Toggle Latch |
Boolean |
Expected values 0 or 1 |
Bounce Count |
Int32 |
Expected values positive integer |
1.Debounce signal
When input is steady at 0 for a Debounce period (or longer), the output state is 0 (FALSE). When input is steady at 1 for a Debounce period (or longer), the output state is 1 (TRUE). Debounce period is calculated as follow,
Debounce period (sec) = Debounce count * Sample time (sec).
User can set two different debounce periods for the rising and falling edge of the debounce signal by selecting different prescale values in the block mask for “Prescale (Debounce count): Rising” and “Prescale (Debounce count): Falling”.
2.SP(Rising) & SP(Faling) Signal
In the SP(Rising), output state will generate a single pulse (one time-step) when the Debounce signal changes from 0-to-1. While in the SP(Falling), output state will generate a single pulse (one time-step) when the Debounce signal changes from 1-to-0.
3.Toggle latch
Output state will toggle when the Debounce signal changes from 0-to-1.
4.Bounce count
Bounce Count indicate the number of state changes detected when the Debounce signal is at 1.
Configuration Parameter |
Selectable Option/Value |
Description |
||||||||||||
Prescale (Debounce count): Rising |
|
Select the prescale value. Depending on this parameter debounce period for rising edge detection will be calculated as follows:
-Debounce period (sec) = Debounce count * Sample time (sec) |
||||||||||||
Prescale (Debounce count): Falling |
|
Select the prescale value. Depending on this parameter debounce period for falling edge detection will be calculated as follows:
-Debounce period (sec) = Debounce count * Sample time (sec) |
No known limitation.
A demo file is provided at:
[<waijung2 installation directory>\waijung2\targets\zynq7000\demo\debounce_demo]
To load the model file run the following commands in the Matlab Command Window:
•Demo 1: waijung2.openDemoInCurrentFolder('zynq7000', 'debounce_demo1')