Fujitsu FR60 Hardware Manual page 468

32-bit microcontroller mb91301 series
Hide thumbs Also See for FR60:
Table of Contents

Advertisement

CHAPTER 15 BIT SEARCH MODULE
■ Change Point Detection
The bit search module scans data written to the change point detection data register from bit30
to the LSB for comparison with the MSB value. The first location where a value that is different
from that of the MSB is detected is returned. The detection result can be obtained by reading
the detection result register.
The relationship between the detected location and the return value is given in Table 15.3-1. If a
change point is not detected, 32 is returned. In change point detection, "0" is never returned as
a result.
[Execution example]
00100000000000000000000000000000
00000001001000110100010101100111
00000000000000111111111111111111
00000000000000000000000000000001
00000000000000000000000000000000
11111111111111111111000000000000
11111000010010011110000010101010
10000000000000101010101010101010
11111111111111111111111111111111
Table 15.3-1 Bit Locations and Return Values (Decimal)
Detected
Return
bit
value
location
31
0
30
1
29
2
28
3
27
4
26
5
25
6
24
7
■ Save/Restore Processing
If it is necessary to save and restore the internal state of the bit search module, such as when
the bit search module is used in an interrupt handler, use the following procedure:
1) Read the 1 detection data register and save its contents (save).
2) Use the bit search module.
3) Write the data saved in 1) to the 1 detection data register (restore).
With the above operation, the value obtained when the detection result register is read the next
time corresponds to the value written to the bit search module before "1".
If the data register written to last is the 0 detection or change point detection register, the value
is restored correctly with the above procedure.
448
Write data
Detected
Return
bit
value
location
23
8
22
9
21
10
20
11
19
12
18
13
17
14
16
15
Read value (decimal)
(20000000
)
--> 2
B
H
(01234567
)
--> 7
B
H
(0003FFFF
)
--> 14
B
H
(00000001
)
--> 31
B
H
(00000000
)
--> 32
B
H
(FFFFF000
)
--> 20
B
H
(F849E0AA
)
--> 5
B
H
(8002AAAA
)
--> 1
B
H
(FFFFFFFF
)
--> 32
B
H
Detected
Return
bit
value
location
15
16
14
17
13
18
12
19
11
20
10
21
9
22
8
23
Detected
Return
bit
value
location
7
24
6
25
5
26
4
27
3
28
2
29
1
30
0
31
inexistent
32

Advertisement

Table of Contents
loading

Table of Contents