Content originally posted in LPCWare by Shoichi Kojima on Thu Sep 27 00:36:24 MST 2012
Hi Karl,
Thank you so much again.
It is a very dense and meaningful suggestion and review comment that I've ever had.
Maybe, the point is ownership, responsibility and utility to S,Sr,P.
In this perspective, in my implementation those are shared by both Master and Slaves. (you may say a not fully I2C-compatible implementation ^^;)
You are asking about my implementation more exactly.
So, let me describe some more.
Basically, I want to implement two kinds of communication.
One is "normal message" and the other is "Command with Operand".
Some commands may require data from the slave (similar to well-known EEPROM read access.)
Not like EEPROM read access, I will not use lonesome
"S SLA+R .... P" style communication (because of multi-master bus configuration to avoid problems.)
Regularly "Normal message" is used.
"Command + Operand" is used only in particular cases, such as initialization, parameter changes, some other house-keeping kind of controls etc... Only one "Operand" payload can follow the "Command". If several bytes of operand-meaning bytes are required, they are to be in one payload.
"Normal message" transfer occurs more often than the other.
Short and simple structure is expected.
So, in summary, follwing two types are used.
S SLA+W "normal message" P
S SLA+W "Command" Sr SLA+R/W "Operand" P
At the end of data payload sequence, P or Sr is treated as a kind of delimiter which determines the category of the data byte sequence made just before them.
Your new proposal
S SLA+W "Command" Sr SLA2+W "Operand" P
Without P in the middle, no other masters can interrupt.
It is good.
Problem to me about this are:
Required plural I2C slave addresses per one physical
slave device.
Still difficult to implement "normal message" type at
the same time.
Regarding former promlem, some I2C-capable MCUs does NOT always have suitable slave-address-match logic to detect plural slave address, and essentially I2C slave address space will be consumed more...
Anyway, I understand your new proposal is worth considering for one of my newer developments with NXP MCU which can handle several slave addresses.
Thank you for your good suggestion.
Finally, I would like to have a hint.
You wrote mine is not fully I2C-compatible.
It may be so... But, at this opportunity, I would like to study I2C spec again to know the reason why you fell so.
Could you tell me where and what description in I2C spec explains so.
Regards,