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.

Variable microsecond delay in C

Status
Not open for further replies.

JeanTech

Member
Hi there

I'm currently busy with a project that generates PPM frames to control an RC plane. I'm using mikroC to compile
my project and I'm using a PIC16F627A.

I need a way to generate precise microsecond delays at 4Mhz clock. It should also be adjustable (when I
call the procedure it must accept the custom delay time as an argument of the procedure).

My idea is the same as the built-in delay API's, but it must accept variables and not constants (so that I can
adjust delay times in runtime).

How can I generate the microseconds delay routine in C?

Thanks in advance
JeanTech
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top