I2C/Talking to a chip/Registers: the drawers inside

Registers: the drawers inside

An address picks a chip; a register picks something inside it. The controller writes a register's number to move the chip's pointer, and every read returns whatever the pointer is at.

A chip usually holds more than one thing. The LM75 temperature chip holds four, each in its own numbered register:

RegisterHoldsAt power-up
0x00the temperaturethe last reading
0x01configuration0x00
0x02hysteresis75 °C
0x03overtemperature80 °C

The chip keeps a pointer to one of them. Writing a register's number to the chip moves the pointer, and a read returns what is in the register the pointer is at. The pointer stays put, so a program that only ever wants the temperature can point at 0x00 once and read as often as it likes.

Door and drawer

Beginners mix up the two numbers in every I2C read, and they are different kinds of thing:

  • 0x48 is the address: which chip, of all the chips on the bus.
  • 0x00 is the register: which drawer, inside that chip.

A read that comes back with the wrong kind of number, 80 where you expected a room temperature, is usually a pointer left at the wrong register, not a broken chip.

The 80 °C and 75 °C are the LM75B's alarm limits as it powers up: its OS output switches on above 80 °C and off again below 75 °C. On our TK42 board that output is not connected, so the limits do nothing there, and the registers are still there to read and write.

Edit this page — content/fundamentals/i2c/registers.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Fundamentals on the forum →