Rising And Falling Edge; Analog Input And Thresholds - UIrobot UIM2842 User Manual

Can2.0b instruction control, miniature integrated stepper motor controller (closed-loop) v1.0
Table of Contents

Advertisement

Miniature Integrated Stepper Motor Controller(

8.1 Rising and Falling Edge

When port S1 and S2 is configured for digital input, if the sensor module detects a voltage
change on S1(S2) from 0V to 5V, an Sx rising-edge event will be created, meanwhile S1(S2)
is assigned a logic value 1 (i.e. S1=1). If the sensor module detects a change on S1(S2)
from 5V to 0V, an S1(S2) falling-edge event will be created, meanwhile S1(S2)=0.
Figure8-5: Rising and Falling Edge of a Digital Sensor Input
Voltage on Port S1(S2)
5V
Voltage on port S1(S2)
0V

8.2 Analog Input and Thresholds

Figure8-6: Analog Input and Thresholds
Voltage on
Sensor Port
5V
Thd_H
Analog
Input
Thd_L
0V
S1 Logic Value
1
S1
0
Sensor input port S1 can be configured for analog input by instruction. To do that, user
needs to first enable the analog input function by set the ANE bit of the master configuration
register (i.e., MCFG<ANE> =1). Then, user needs to select the analog input port by clear
the CHS bit of the master configuration register (i.e., make MCFG<CHS> =0). Once
configured, the analog voltage on port S1 can be obtained by instruction SFB.
In order to use the sensor events, user may need to further setup the input upper and lower
thresholds (i.e., AH / AL in figure 8-2). If the sensor module detects the analog input voltage
is changing from lower than AH to high than AH, an S1 rising-edge event will be created,
meanwhile S1 is assigned a logic value 1 (i.e. S1=1). If the sensor module detects a
change on S1 from higher than AL to lower than AL, an S1 falling-edge event will be created,
meanwhile S1=0. Otherwise, S1 is kept unchanged.
UI Robot Technology Co. Ltd.
Falling
Rising
Edge
Edge
Though voltage on sensor port is
lower than Thd_H, S1 is still 1
Falling
Edge
Rising
Edge
M4220170607EN
Closed-loop
S1 / S2(Logic Value)
1
0
S1 logic value
1
0
Though voltage on sensor port is
higher than Thd_L,S1 is still 0
Rising
Edge
)
T(Time)
T(Time)
T(Time)
Page 45

Advertisement

Table of Contents
loading

Table of Contents