The 4 digital pins of the RevPi MIO can be used flexibly as inputs or outputs and in various operating modes. In the following examples, you will configure them in PiCtory.

Using Digital Input for Level Detection #

▷ Set in the Value Editor IO_Mode_1 to digitalIn.

Restart the driver to apply the changes.

❯ The digital level is displayed at DigitalInput_1.

Using Digital Input for PWM Measurement #

▷ In the Value Editor, set IO_Mode_1 to pwmIn.

▷ If necessary, configure the duty cycle at PwmDutycycle_1.

Restart the driver to apply the changes.

❯ The frequency and duty cycle are displayed at Fpwm_PulseCount_1 .

Note

If no edge is detected for longer than 10 seconds, PwmDutycycle_1 and Fpwm_PulseCount_1 display the value 0.

Using Digital Input for Pulse Measurement #

▷ In the Value Editor, set IO_Mode_1 to pulseIn.

Restart the driver to apply the changes.

❯❯ The pulse length is displayed at DutyCycle_PulseLength_1.

❯❯ The number of pulses is displayed in the Fpwm_PulseCount_1 field.

Using Digital Output for PWM Output #

▷ In the Value Editor, set IO_Mode_1 to pwmOut.

▷ Set the PWM frequency at FpwmOut_12.

▷ Set the duty cycle at PwmDutycycle_1.

Restart the driver to apply the changes.

❯❯ A PWM signal is displayed at the output.

Using Digital Output for Pulse Output #

▷ In the Value Editor, set IO_Mode_1 to pulseOut.

▷ Optional: activate PulseMode = 1 for the retrigger mode (if you want to start several pulses in quick succession).

▷ Set the pulse length under Dutycycle_Pulselength_1.

Restart the driver to apply the changes.

▷ Set DigitalOutput_1 to 1 to start the pulse.

Without retrigger mode: A pulse runs out completely before a new one can be started. DigitalOutput_1 must be reset to 0 before each new pulse.

With retrigger mode: A new pulse can be started immediately, even if the previous pulse is still running. Every new impulse restarts its predecessor.

Using Digital Output for Level Output #

▷ In the Value Editor IO_Mode_1 set to Output.

Restart the driver to apply the changes.

❯ Set DigitalOutput_1 to 0 (low) or 1 (high) to control the level.