This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
#define CPU_F ((double)20000000) //1000000为MCLK=1MHZ 的意思
//#define delay_us(x) __delay_cycles((long)(CPU_F*(double)x/1000000.0))
//#define delay_ms(x) __delay_cycles((long)(CPU_F*(double)x/1000.0))
#define delay_us(A) __delay_cycles( (unsigned long) ( (double)(CPU_F) *((A)/1000000.0) + 0.5))
#define delay_ms(A) __delay_cycles( (unsigned long) ( (double)(CPU_F)*((A)/1000.0) + 0.5))
#define delay_s(A) __delay_cycles( (unsigned long) ( (double)(CPU_F)*((A)/1.0) + 0.5))
以前用的是这种,后来发现并不准确,请大家帮帮忙啊~~
您好。
__delay_cycles是相对来说比较准确的方式了。
问您两个问题:
1、能不能描述一下不准确的现象?
2、MCLK频率是多少?用IO口输出来看看;
3、您用的MSP是哪个型号?如果4、5系列使用FLL,要准确得多的