2200 views|2 replies

3836

Posts

19

Resources
The OP
 

[Precise delay function] Precise delay function in IAR (MSP430) [Copy link]

In the compiler of IAR software 430, we can use its internal delay subroutine to achieve the high-precision software delay we want. The method is as follows: The details are as follows [quoted from others, this delay function is very high]: Note: __delay_cycles(x), x must be a constant or a constant expression. If it is a variable, a compilation error will be reported! Accurate software delay method in IAR FOR AVR Delay functions are often used when using microcontrollers, and 430 is no exception. Common forms are: void delay(unsigned int ms) { unsigned int i,j; for( i=0;i" __delay_cycles((long)(cpu_f*(double)x="" color][="" cpu_f="" cpu的主频频率,即cpu的mclk。[="" delay_ms(x)="" delay_us(x)="" div="" iar="" size]="" 修改成你当前msp430="" 延时1秒[="" 延时3.5微秒[="" 延时3.5毫秒[="" 微秒的延时[="" 毫秒的延时[="" 的意思。[="" 语句里="" 软件430的编译器里面我们可以利用它内部的延时子程序来实现我们想要的高精度软件延时,方法如下:[="">
Thanks for sharing, I learned a lot!

I have used this delay function and it is indeed more accurate.

[Precise delay function] Precise delay function in IAR (MSP430)


This post is from Microcontroller MCU

Latest reply

I have used this delay function and it is indeed more accurate.  Details Published on 2019-3-7 10:05
 

821

Posts

0

Resources
2
 
Thanks for sharing, I learned a lot!
This post is from Microcontroller MCU
 
 

6366

Posts

4929

Resources
3
 
I have used this delay function and it is indeed more accurate.
This post is from Microcontroller MCU
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list