[email=ATMEGA168@10M]ATMEGA168@10M[/email].编译后61%资源利用.部分程序失调了..
想通过下述程序发出一个小脉冲,然后一定延时后再发一个窄脉冲.可我调整asm("nop")
延时并没按NOP的多少变化.而是乱的.简单的讲,5个NOP是1US.10个NOP是6US???
也实验用FOR循环同样...不知道问题是资源不够还是堆栈问题.可以编译后无提示错误和警告...WHY?
void PulseOut(void)
{
uchar ti;
DRIVE_ON;
for(ti=0;ti<5;ti++)
asm("nop");
DRIVE_OFF;
//以下为延时指令.
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
asm("nop");asm("nop");asm("nop");asm("nop");asm("nop");
DRIVE_ON;
asm("nop");
DRIVE_OFF;
} |