OpenMarine
Why are 16 _nop_() used for the 5us delay in the MCU control bmp180 sensor program? - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=2)
+--- Thread: Why are 16 _nop_() used for the 5us delay in the MCU control bmp180 sensor program? (/showthread.php?tid=3753)



Why are 16 _nop_() used for the 5us delay in the MCU control bmp180 sensor program? - KAKU - 2021-10-28

Dear all,
The procedure for bmp180 control is as follows:
void Delay5us()
{
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
_nop_();_nop_();_nop_();_nop_();
}
11.0592mhz crystal oscillator
 Shouldn't one _nop() shouldn't be a machine cycle, now it is 1.085us under the crystal oscillator?

Hope to explain why this 5us delay uses 16 nop
Note: the microcontroller I used is stc89c52rc and referred tobmp180 datasheet.
Thank you very much!
K