[En-Nut-Discussion] Special Multi Master I2C and AVR mega644

Ulrich Prinz ulrich.prinz at googlemail.com
Sat Jan 11 12:34:09 CET 2014


Hi!

I need develop a small device based on mega644 that adapts to an existing
I2C bus. This bus is sort of multi-master. There are several boards
connected to it that need to be informaed about actions and status. All
write and read to the same Address.

Is works like this:
S = START, P = STOP
W = Write, R = Read
a = ACK
n = NACK

Send button 1 press: SW 0xAAa 0x22a 0x50aP  SR 0xABa 0x22a 0x50nP

So the sequence to broadcast the button press is first written, then read
again.
The problem seems to be, that I need to listen to the same address than I
write to.
Think of buttons with LEDs. If I press the button, the action is send, and
with reception fo the status, I switch on the LED in the button. But if
some other device requesting the same action, I need to get the commend
too, and activate the LED. So all devices listen to address 0xAA and write
to this address. Unfortunately this is not Address 0x00 what would have
been the General Call Address.
It is, again, a severe I2C protocol violation.

I tested Fleury code, modified Fleury code, FreeRTOS code and many many
more. Current NutO/S doesn't install properly on my Ubuntu 13.10...
All stacks I tested hang at different points:
Some insist on sending a repeated start between the two packets.
Some miss to send a Stop after the written packet.
Some block the whole system while transmission.
Some stumble about the fact, that they have to send data to them selfes.

There are two questions by now:
Does someone have a tiny version of NutO/S for that works on mega644
Does someone know a modified I2C stack that eats this stupid protocol above?

It is 'just' a prototype, but it will be shipped to an exhibition on
Tuesday. :)

Ulrich


More information about the En-Nut-Discussion mailing list