P peterzatko New Member Sep 25, 2012 #1 I have a PIC 18F252 with external crystall 8 MHz and i need help. I need change delay . Here is my code in mikrobasic freq: q = Integer(PORTB) t = 1250/q LED6 = 1 delay_us("t") - I need change these time from 4uS to 1250uS LED6 = 0 delay_us("t") - I need change these time from 4uS to 1250uS goto freq
I have a PIC 18F252 with external crystall 8 MHz and i need help. I need change delay . Here is my code in mikrobasic freq: q = Integer(PORTB) t = 1250/q LED6 = 1 delay_us("t") - I need change these time from 4uS to 1250uS LED6 = 0 delay_us("t") - I need change these time from 4uS to 1250uS goto freq
be80be Well-Known Member Sep 25, 2012 #2 You need to set t as a word I don't see what your trying to Do with q but it you set t as word its just t = 1250 and get rid of ""
You need to set t as a word I don't see what your trying to Do with q but it you set t as word its just t = 1250 and get rid of ""
Mr RB Well-Known Member Sep 26, 2012 #4 delay_us() is a hard coded delay time, and cannot use a variable. try using vdelay_us() (and read the help file with Mikrobasic) as vdelay_us() allows you to use a variable to set the delay.
delay_us() is a hard coded delay time, and cannot use a variable. try using vdelay_us() (and read the help file with Mikrobasic) as vdelay_us() allows you to use a variable to set the delay.