What is the difference between 7-bit and 10-bit I2C addressing?
7-bit addressing uses 7 bits to identify a device on the I2C bus, allowing up to 128 addresses. 10-bit addressing uses 10 bits, allowing more devices (up to 1024 addresses) on the bus.
Click to reveal answer
beginner
How is a 7-bit I2C address transmitted on the bus?
The 7-bit address is sent in the first 7 bits of the address byte, followed by a single bit indicating read (1) or write (0).
Click to reveal answer
intermediate
How does 10-bit addressing start on the I2C bus?
It starts with a special 7-bit code '11110XX' where XX are the two most significant bits of the 10-bit address, followed by a read/write bit, then the remaining 8 bits of the address.
Click to reveal answer
intermediate
Why would you use 10-bit addressing instead of 7-bit?
Use 10-bit addressing when you need to connect more than 127 devices on the same I2C bus, as 7-bit addressing limits the number of unique addresses.
Click to reveal answer
beginner
In embedded C, how do you typically specify a 7-bit I2C address?
You specify the 7-bit address shifted left by 1 bit, leaving the least significant bit for read/write control.
Click to reveal answer
How many unique device addresses can 7-bit I2C addressing support?
A. The read/write bit in header should be 0 for read
B. The low_addr should be shifted left by 1 before sending
C. The header calculation is correct; no error
D. The mask 0x06 should be 0x07 to include all bits
Solution
Step 1: Check read/write bit in header
For read operation, the last bit is set to 1, which matches the code.
Step 2: Verify mask and low address
Mask 0x06 correctly extracts bits 7 and 8; low_addr is the lower 8 bits, no shift needed.
Final Answer:
The header calculation is correct; no error -> Option C
Quick Check:
Header and low_addr correct for 10-bit read [OK]
Hint: Check read/write bit and mask carefully [OK]
Common Mistakes:
Confusing read/write bit value
Incorrect mask for bits 7 and 8
Shifting low address unnecessarily
5.
You need to write a function in embedded C that takes a 10-bit I2C address and returns the two bytes to send: the header byte and the low address byte for a write operation. Which of the following implementations is correct?