Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Delay in the segment of the program (http://www.chiefdelphi.com/forums/showthread.php?t=43680)

Lessa 10-02-2006 01:47

Delay in the segment of the program
 
Hi guys,

Please help me...

I have a problem with a creating delay on micro controller. How to create one delay for PIC18F8722? if possible in language C.

how?

Thanks!

Eldarion 10-02-2006 02:06

Re: Delay in the segment of the program
 
Quote:

Originally Posted by Lessa
Hi guys,

Please help me...

I have a problem with a creating delay on micro controller. How to create one delay for PIC18F8722? if possible in language C.

how?

Thanks!

You cannot use a standard delay (I.E. one made with a while or for loop) on the RC without asking for trouble ("the red light of death"). Instead, you may want to create a counter, such that every program loop (approx. 26.6ms, though it can be more) increments the counter. When the counter is greater than a certain value, you do whatever the delayed action was.

A more precise way to do this is to set a hardware timer (white paper on the IFI website under legacy documents) to fire every 25ms or so, and increment your counter there.

Hope this helps, and if it's clear as mud just let me know! :D


All times are GMT -5. The time now is 13:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi