Pic 18f252

Status
Not open for further replies.

peterzatko

New Member
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
 
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 ""
 
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.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…