We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello everyone, I am not able to figure out the maximum delay value i can give.If i give to high the simulator stops at that function,please suggst me the maximum delay i can give. Here's the code:
//square wave generator #include <reg52.h> #define on 1; #define off 0; void delay(void); sbit switchpin = P1^0; sbit sqgen = P2^1; void main(void) { P2 = off; while(1) { if(switchpin == 1) { sqgen = on; delay(); sqgen = ~sqgen; } else sqgen = off; } } void delay(void) { int i=0; for(i=0;i<=29000;i++); }
The value of 'i' in the delay function is what i am referring to. Thanks in advance, Arun
So don't fall into the newbie trap of relying upon HLL delay loops:
http://bit.ly/YPhiRO
Thanks for that Andrew,will do it right away.