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.

I2C Interrupt vs Polling Method;

Status
Not open for further replies.

chandu.kurapati

Full Member level 3
Full Member level 3
Joined
Oct 31, 2013
Messages
186
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Location
Bengaluru, India
Visit site
Activity points
2,778
Hi,

I observed that in most of the cases I2C is Configured with Polling method instead of interrupt method.why? what is the reason for it?

I think Interrupt method is some what efficient then the polling method, but why polling method is considered in most of the cases, can any one explain about it.

Thanks & Regards,

Chandu.Kurapati.
 

When I started using interrupts method, it was horrible because Interrupts increase risk by being non-synchronous(mostly delaying) with the rest of the program and it took time to understand how to use interrupt. You can remove this unsync part, but it adds more code, ram usage, and time to execute. It gets harder to debug with interrupts. You could be tracing one line at a time in the C source code, but not have a clue how many ISR were called in between each step and most systems are plenty responsive with polling.
 
Hi,

For general difference between polling vs interrupt method is ok, but why in I2C most of the cases polling method is followed. There is any reason, can any one explain it.

Thanks & Regards,
Chandu.Kurapati.
 

Because it is easier to implement that's why programmer's use polling method.

Polling method wastes many cpu cycles by waiting for a particular flag to get set, that's why interrupt method is used.

Polling Method Pros:-
Easier to Implement

Polling Method Cons:-
Waste CPU Cycles by waiting.

Interrupt Method Pros:-
CPU cycles are utilized efficiently.

Interrupt Methods Cons:-
Complex programming and handling.
 

The other reason is of course that many processors do not have hardware I2C interfaces so their programming has to rely on polling. I'm not sure if I2C is still a licensed protocol, it certainly used to be. If the license still exists it would force manufacturers using hardware interfaces to pay royalties to Philips.

Brian.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top