394
Chapter 28 Bit Search
7.Q & A
7. Q & A
7.1 How is data written?
Writes data with the detection data registers (BSD0, BSD1, BSDC).
7.2 How is scanning started?
Scanning is started once data is written in the detection data registers (BSD0, BSD1, BSDC).
7.3 How is a result read?
The detection result register (BSRR) is read.
7.4 How is the previous bit search state restored?
The following restoration processes are performed.
If you need to restore the previous bit search state after a bit search has been executed in an interrupt
handler.
1) Reads data from the one detection data register, and saves the contents. (evacuation)
2) The Bit search is used.
3) Writes data evacuated in Item 1) in the one detection data register. (restoration)
Using the above procedures, the value to be read next from the detection result register is the one that was
written in the bit search executed in 1) or before.
The bit search state can be correctly restored using the above procedures even if the 0-detection, 1-detection
or changing-position-detection data register has been written last.
Operation mode Detection data register
“Zero” position detection write Writes data in (BSD0)
“One” position detection write Writes data in (BSD1)
Changing position detection write Writes data in (BSDC)