Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

polling - busyflag's advantage and disadvantage toward delay

Status
Not open for further replies.

muhammedan

Newbie level 4
Newbie level 4
Joined
Feb 18, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,309
polling

hello everybody.I want to know about busyflag's advantage and disadvantage toward delay?
 

Re: polling

we can say both will put the control in waiting state. If the busy flag is using the control will wait until the busy flag bits are changing. The delay can exit from the waiting state when the time expires.

Geo
 

Re: polling or what else?

If your CPU has only one task, waiting for the event that sets the flag, polling does not add delay, in fact it might be faster than an interrupt. If you need to perform other tasks while waiting for the flag, the delay is anywhere between nothing and the maximum run time of your other task.
Another side effect to consider, if you are waiting for a long time (e.g. milliseconds), you can put the CPU into idle mode and save a lot of power. The interrupt will wake up the CPU and there is no additional delay penalty.
The easiest way to write a small program is to use polling. As soon as you do multitasking, interrupts are advisable or using a task scheduler that assigns a certain time slot to each task. This makes your max. delay most predictable but your overall program more complicated.

Hope that helps, Bob
**broken link removed**
 

Re: polling

Hi,
For task oriented waiting/delay, the busyflag help is taken to wait for setting the flag and delay routine is mostly used for time delay purpose in between tasks. With clever programming, benefit of both can be interchanged but it is better to make the program simple and use the two in different purposes. With thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top