[hpsdr] MicSamples from Penelope (3)

Jeremy McDermond mcdermj at xenotropic.com
Mon Dec 27 13:13:36 PST 2010


On Dec 27, 2010, at 12:07 PM, wully wrote:

> Hi Jeremy
> 
> Thank you for pointing me into the right direction: that was just the missing thing: how to control the TLV320AIC.
> I will try to run these things and then figure out, how to program it directely in my own code.
> 
> Does a spec exist on the control of the I2C-Bus from Ozy?

My understanding is that only the TLV320 on Penelope is controlled via i2c.  There is a hardware limitation that prevents more than that.  That's why those sorts of parameters on Mercury are controlled with the USB packet header instead of i2c.  There is no spec per se on the i2c bus control, it's a part of the FX2 chip I believe.  If you notice in the initozy script, it will tell you the parameters it is setting, and all of the parameters for the TLV320 are available via the datasheet.  If you're wondering how to twiddle the FX2 to get the i2c to work, you can either look at the write_i2c program for either Windows or Linux, my Mac version of write_i2c is available on my SVN at https://www.xenotropic.com/ham-svn/OzyUtils-MacOS/OZY.c (But it does not use libusb.  It's been ported to use the native Mac IOKit calls to manipulate the USB.  If you understand the USB protocol, though, it's not that hard to understand.)  Basically you just send the FX2 a request on the control channel with:

                bmRequestType = VENDOR_REQ_TYPE_OUT;
                bRequest = VENDOR_REQ_I2C_WRITE;
                wValue = i2c_addr;
                wIndex = 0;
                pData = byte;
                wLength = length;

where:

#define VENDOR_REQ_TYPE_OUT (0x40)
#define VENDOR_REQ_I2C_WRITE (0x08)

i2c_addr is the i2c address
byte is the data
and length is the length of byte.

Notice that this can be simplified because the initialization routines always send two bytes (note the third byte in the command lines are all zero).  So, the first line:

write_i2c $USB_VID $USB_PID 0x1b 0x1e 0x00 0x00 2
 
Will send a control request with:

                bmRequestType = VENDOR_REQ_TYPE_OUT;
                bRequest = VENDOR_REQ_I2C_WRITE;
                wValue = 0x1b;
                wIndex = 0;
                pData = { 0x1e, 0x00 };
                wLength = 2;

Does that get you started down the right road?

> 73 de HB9EPU, Alfred

--
Jeremy McDermond (NH6Z)
Xenotropic Systems
mcdermj at xenotropic.com




 1293484416.0


More information about the Hpsdr mailing list