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
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.
 

tantalos

Junior Member level 3
Junior Member level 3
Joined
Oct 12, 2014
Messages
27
Helped
6
Reputation
12
Reaction score
6
Trophy points
3
Location
Upper Silesia, Poland
Activity points
180
I always use the interrupt method. In my opinion people use polling because it is easer to implement.
 

vicky001.iith

Advanced Member level 4
Full Member level 1
Joined
Aug 5, 2013
Messages
113
Helped
37
Reputation
74
Reaction score
31
Trophy points
48
Location
INDIA
Activity points
721
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.
 

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
Activity points
2,778
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.
 

xpress_embedo

Advanced Member level 4
Advanced Member level 4
Joined
Jul 5, 2011
Messages
1,154
Helped
161
Reputation
396
Reaction score
189
Trophy points
1,353
Location
India
Activity points
10,578
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.
 

betwixt

Super Moderator
Staff member
Advanced Member level 7
Joined
Jul 4, 2009
Messages
15,799
Helped
5,088
Reputation
10,201
Reaction score
4,952
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
133,789
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.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top