Input Capture
Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.
Libraries:
Simulink Support Package for Arduino Hardware /
Common
Description
The Input Capture block measures the frequency and duty cycle of the external input signal on the digital pin of the Arduino® hardware board. The block utilizes the timer counters available on the Arduino hardware board along with the interrupt service routines to compute the frequency and duty cycle of the external input signal.
You can run a Simulink® model containing Input Capture block in Connected IO mode on Arduino boards.
For more information on the conflicting usage of digital pins for a Simulink model that uses one or more combination of PWM, Standard Servo Read, Standard Servo Write, Continuous Servo Write, and Input Capture blocks, see the Conflicting Pin Configurations on Arduino Timer section.
Limitations
This table lists the maximum measurable frequency and their corresponding measurable duty cycle range for the Arduino boards.
Arduino Board Architecture | Maximum Measurable Frequency | Measurable Duty Cycle Range |
---|---|---|
AVR | 50 KHz | 20 % to 80 % |
SAMD | 400 KHz | |
SAM | 400 KHz | |
Nano 33 BLE Sense | 50 KHz |
This table lists the maximum and minimum frequency and duty cycle that can be measured using the Arduino-compatible Teensy 4.0 and 4.1 boards.
Arduino Board Architecture | CPU Frequency (MHz) | Minimum and Maximum Measurable Frequency Range | Measurable Duty Cycle Range |
---|---|---|---|
Teensy 4.0 and 4.1 | 1008 | 1.2KHz - 1MHz | 20 % to 80 % |
960 | |||
912 | |||
816 | |||
720 | |||
600 | |||
528 | |||
450 | |||
396 | 1.2KHz - 500KHz | ||
150 | 1.2KHz - 250KHz | ||
24 | 200Hz - 5KHz |
Ports
Output
Parameters
Version History
Introduced in R2020b