Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

Back
Top