新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > stm32的微秒延時程序

stm32的微秒延時程序

作者: 時間:2016-11-11 來源:網(wǎng)絡 收藏
我的stm32系統(tǒng)時鐘為72MHZ,用軟件延時方法實現(xiàn)微秒級的延時,既空循環(huán):

延時函數(shù)為:

本文引用地址:http://butianyuan.cn/article/201611/316910.htm

#definedelayUs(x){ unsigned int _dcnt;
_dcnt=(x*16);
while(_dcnt-- > 0)
{ continue; }
}

x---------為延時時間(單位為us)

其中_dcnt=(x*16); 中的16,是可以改的,改為8的時候延時間時間為x*0.5。



關(guān)鍵詞: stm32微秒延時程

評論


技術(shù)專區(qū)

關(guān)閉