Wiki

The most recent version of this page is a draft.DiffThis version (10 May 2021 08:25) was approved by Prasad Kamath.The Previously approved version (21 Mar 2021 08:48) is available.Diff

This is an old revision of the document!


Click here to return to the GPIO Conditioning page

Push and Hold



Description


This block can be used for functions like a pushbutton, to condition a GPIO input to create pulses in response to the user pushing or holding the button.

Usage


A typical application would be a volume control comprising two buttons, one for up and the other for down.

  1. Drag the block into the workspace.
  2. Right-click it and select the algorithm:
    • push_hold
    • push/hold 2-in 2-out
    • push/hold with two-button mute
  3. Set the parameters to fit your application:


Note: For the picture above right, push_hold was selected. Use push/hold 2-in 2-out to condition two GPIO inputs, for example one up and one down. Push/hold with mute works the similarly but with the extra feature that if both buttons are pressed, a mute pulse is generated (bottom output pin). To un-mute, any of the buttons can be pressed.


Targets Supported

NameADSP-214xxADSP-215xx/ADSP-SC5xxADAU145x/1456x
—————————————-——————————————————————————————--——————————————-
Push and Hold Not supported Not supported Sample


Pins

Input

NameTypeDescription
———————————-————————————————————
Input0ControlControl Signal input that is detected by the push and hold

Output

NameTypeDescription
———————————-—————————————————————————--
Output0ControlPush and hold output


Configurable Parameters

GUI Parameter NameDefault ValueRangeFunction Description
—————————————- ———————- ————————————- —————————————-
Hold 5000 to 10000 Determines how long the signal is held before the repeat pulses are generated.
Repeat 250 0 to 10000 Sets the interval between repeated pulses. Enter the time in milliseconds in the field.


DSP Parameters

Parameter NameDescriptionADAU145x/ADAU146x
——————————————————————-- ———————————
holdtime hold time in samplesFixed Point 32.0
repeattime repeat time in samples Fixed Point 32.0


DSP Parameter Computation


holdtime= Hold*0.001*FS
repeattime= Repeat*0.001*FS
FS - sampling rate

/srv/wiki.analog.com/data/pages/resources/tools-software/sigmastudiov2/modules/gpioconditioning/pushandhold.txt · Last modified: 12 May 2021 14:26 by Prasad Kamath