Please enable JavaScript to view this site.

Waijung 2 User Guide

Design overview

Debounce block appearance in a Simulink model,

zynq_7000_debounce_block_1

Debounce block mask overview,

zynq_7000_debounce_block_2

Debounce block input interfaces

Name

Type

Range

Input Signal

single

double

int8

int16

int32

uint8

uint16

uint32

Boolean

Expected values 0 or 1

Debounce block output interfaces

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

Debounce block behavior

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.

Debounce block configuration

Configuration Parameter

Selectable Option/Value

Description

Prescale (Debounce count): Rising

4

256

8

512

16

1024

32

2048

64

4096

128

8192

 

 

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

4

256

8

512

16

1024

32

2048

64

4096

128

8192

 

 

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)

Debounce block limitations

No known limitation.

typical application

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')

 

Copyright 2023 Aimagin Co.,Ltd. Rev.779