Skip to contentSkip to conversation

Read word

DISCUSSION Jean Delvare 2 participants 3 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

Hi all,

Are there negative side effects trying to read an I2C chip register in byte mode while it is supposed to be read in word mode? I'm thinking of using this to enhance our LM75 detection. Since the LM75 returns the words high byte first, while other chips usually return low byte first, we could try and read registers 0, 2 and 3 in byte mode and make sure that the byte returned matches the high byte, not the low byte, of the words we previously read.

Just a thought, comments welcome.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#1 lore raw

sounds harmless to me
(famous last words...)

Quoted 16 lines · Jean Delvare

Hi all,

Are there negative side effects trying to read an I2C chip register in byte mode while it is supposed to be read in word mode? I'm thinking of using this to enhance our LM75 detection. Since the LM75 returns the words high byte first, while other chips usually return low byte first, we could try and read registers 0, 2 and 3 in byte mode and make sure that the byte returned matches the high byte, not the low byte, of the words we previously read.

Just a thought, comments welcome.

--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/

#2 lore raw
In reply to Jean Delvare
Quoted 11 lines
Quoted 8 lines

Are there negative side effects trying to read an I2C chip register in byte mode while it is supposed to be read in word mode? I'm thinking of using this to enhance our LM75 detection. Since the LM75 returns the words high byte first, while other chips usually return low byte first, we could try and read registers 0, 2 and 3 in byte mode and make sure that the byte returned matches the high byte, not the low byte, of the words we previously read.

sounds harmless to me
(famous last words...)

Whatever, my proposal doesn't make sense. Reading a word register in byte mode will always return the first byte that would have been returned if read in word mode, wether it is the low or high one. We don't know if the first byte is high or low unless we know what chip we are talking to - while this is precisely what we are trying to detect.

Let's forget about all this, sorry for the noise.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/