ST意法半导体
直播中

马知一

7年用户 216经验值
私信 关注
[问答]

可以用TIMER4创建1微秒的延迟吗?

大家好,


我使用的是STM8S105和STM8S003。我们可以用tiMER4创建1微秒的延迟吗?我可以创建延迟1ms,100us,10us但不能延迟1us。我们可以吗?

谢谢!

以上来自于谷歌翻译


以下为原文




Hello everyone,


I am using STM8S105 and STM8S003. Can we create delay 1 microsecond with TIMER4? I can create delay 1ms, 100us, 10us but can not for delay 1us. Can we?

Thank you!

回帖(1)

王若鸿

2019-4-1 07:25:03
你好,
 
使用:
void _delay_1us(void)
{
 NOP();
 ..
 NOP();
}
但每次需要通过示波器验证延迟时间,
因为STM8中的指令执行时间是不可预测的。
由于同样的原因,TIM4无法做到这一点。

以上来自于谷歌翻译


以下为原文





Hello,

Use:
void _delay_1us (void)
{
nop();
..
nop();
}
but the length of the delay each time you need to verify through an oscilloscope,
because the instruction execution time in STM8 is unpredictable.
After the TIM4 can not do this, for the same reason.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分