This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
i2c: polled or interrupts?
- From: Rutger Hofman <rutger at cs dot vu dot nl>
- To: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 10 Jul 2007 00:44:45 +0200
- Subject: [ECOS] i2c: polled or interrupts?
Hi list,
what would be the most sensible way to manage an i2c device as a master:
polling or interrupts? Currently, my feeling is to favour polling
because interrupts can arrive at a stunning rate, up to 400,000 per
second (i2c Fast mode). My processor (XScale PXA270, which has two
builtin i2c devices) may take in the order of a us. to service an
interrupt, because usually devices are connected to the slow 13MHz
device clock, which takes a few cycles to respond and synchronise.
Moreover, having interrupts would add to the Worst Case Interrupt
Response Time for the important, time-critical devices, while my feeling
is that in polling mode the Interrupt Response Time would hardly be
influenced.
On the other hand, the examples in eCos CVS seem to favour interrupt mode.
What does the list think about this?
Rutger Hofman
VU Amsterdam
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss