discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] I2C Addresses


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] I2C Addresses
Date: Mon, 8 Sep 2003 13:08:26 -0700
User-agent: Mutt/1.4.1i

On Sun, Sep 07, 2003 at 05:59:27PM +1000, Alan Gray wrote:
> Hi all,
> 
> In microtune_4937.cc the address listed for the tuner is 0x61 = 0110 0001
> From the data sheets and the connections made (ie pin 11 to ground) I get 
> an address of 0xC0 = 1100 0000

The bottom bit of what's on the wire in the "Address Byte" of an I2C
command is actually the R/W bit.  What you see on the wire is the real
address, shifted one left, and then the bottom bit is a 0 for Write or
a 1 for Read.  See i2c::write in gnuradio/src/gnu/lib/grio/i2c.cc

>From the 4937 data sheet (4937-DI5-3x889-2.pdf), page 10, Table 6:

Write data format:

                MSB
Addr Byte:       1   1  0  0  0  MA1 MA0 R/W

Then looking at Table 7, same page:

Talks about how MA1 and MA0 are set as a function of the voltage at
Pin 11 of the package.  With Pin 11 open, MA1 = 0, MA0 = 1.
I know that the table calls this address "C2", but in fact, the R/W
bit is NOT part of the ADDRESS.  Hence, their "0xC2" (1100 0010) is
really "0x61" (0110 0001).

In your case of course, the relevant values are 0xC0 and 0x60.

The code was written assuming general purpose I2C peripherals.  I.e.,
those that can both read and write.  Hence we consider the address to
be the device's actual address and the r/w opcode to be the opcode.
We don't smash them together.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]