i2c slave

Questions on control of serial busses
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

i2c slave

Post by YahooArchive »

does the i2c protocol on the LPC21xx micro controllers use up CPU time as it
checks all the packets been sent along the i2c bus? or does the i2c hardware
inside the micro controller take care of this? and only update the main micro
controller once it has received some data

surely the cpu does not have to pause and check each address to see if the
packet is intended for it??

Thanks :)



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c slave

Post by YahooArchive »

We've never used the i2c hardware to have the CPU act as a slave, but the i2c
hardware does have address filtering. So you won't get an interrupt until the
address match happens.

However, we find the i2c hardware pretty primative on the master side so for
most code we just bit-bang it out, not much more overhead than the interrupts,
as you get interruped on START, address sent, and each byte.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: i2c slave

Post by YahooArchive »

ok cool, i just wanted to confirm this before even trying to play with i2c, dont
want my LPC spending most of its cpu time checking packets going to another
device hehe.

Will definitely use the bit banged routines for my master, and i guess ill have
to try and write the slave routine my self hehe :)

Thanks

Post Reply