This is an old revision of the document!
Click here to return to the GPIO Conditioning page
The Toggle Counter cell counts the number of edges seen on its input pin and outputs the count as a 32.0 integer value. The toggle detection can be set to detect rising or falling edges on the input.
The toggle counter increments an internal counter each time an edge is detected on the input. Two algorithms exist: one for detecting and counting rising edges, and one for detecting and counting falling edges.
The rising edge counter starts at zero when the program begins. Each time the input detects a rising edge - in any number format - the counter will increment. After the counter exceeds the maximum count value (which can be configured in the GUI), it will reset to zero and resume counting again.
The falling edge counter starts at zero when the program begins. Each time the input detects a falling edge - in any number format - the counter will increment. After the counter exceeds the maximum count value (which can be configured in the GUI), it will reset to zero and resume counting again.
Name | ADSP-214xx | ADSP-215xx/ADSP-SC5xx | ADAU145x/1456x |
---|---|---|---|
—————————————- | —————————————— | ————————————————-- | ——————————————- |
Toggle Counter | Not supported | Not supported | Sample |
Name | Type | Description |
---|---|---|
————— | ——————- | ———————————————————— |
Input0 | Control | Control Signal input that is detected by the toggle counter |
Input1 | Logic | Connected to a software interface register - reads the last count value at startup |
Name | Type | Description |
---|---|---|
————— | ——————- | —————————————————————————-- |
Output0 | Control | Toggle count. Increments by one each time a new edge is detected on the input. |
Output1 | Logic | Other - interface register. Connected to a software interface register - writes the last count value |
GUI Parameter Name | Default Value | Range | Function Description |
---|---|---|---|
—————————————- | ———————- | ————————————- | —————————————- |
Gain | 3 | 3 to 100 | Sets the toggle count at which the counter resets to zero |
IsLin | true | true/false | Setting this value to true indicates the gain is a decimal value, else the value is entered in dB |
Parameter Name | Description | ADAU145x/ADAU146x |
---|---|---|
————— | —————————————————-- | ——————————— |
max | The maximum value that the counter can reach. When the counter exceeds this value, it will be reset to zero | Fixed Point 8.24 |
if IsLin ==true
max= Gain
else
max = 10^ (Gain/20)