discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] is usrper i2c_read suppose to work?


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] is usrper i2c_read suppose to work?
Date: Sat, 14 Jan 2006 14:11:48 -0800
User-agent: Mutt/1.5.6i

On Fri, Jan 13, 2006 at 03:01:24PM -0500, Clark Pope wrote:
> I've been playing with the usrper application. I am able to read and write 
> to the 9862 chips okay but all attempts at using i2c_read fail?

FWIW, I usually prefer to do this kind of experimentation from Python,
but in any event you're probably using an invalid i2c address.

> Is it suppose to work? What is the memory map? 

See usrp/firmware/include/usrp_i2c_addr.h

Note also, that if what you're really trying to do is read the
contents of one of the EEPROM's, you're much better off using
read_eeprom. 

>From python:

   u = usrp.sink_c(0)         # or u = usrp.source_c(0)

   # returns a string
   s = u.read_eeprom(i2c_addr, eeprom_offset, nbytes)
   print s

   # returns a string
   s = u.read_i2c(i2c_addr, nbytes)
   print s


> Also, is there a way to read from the FPGA registers from usrper?

No.  

>From python:

   # returns 32-bit int
   v = u._read_fpga_reg(regno)

Note that there are only 4 readable registers, and I strongly suggest
that you use u.read_io(which_dboard) instead of directly reading
register 1 or 2.

regno   result
-----   --------------------------
  1     (io_rx_a << 16) | io_tx_a      # read d'board i/o pins
  2     (io_rx_b << 16) | io_tx_b      # read d'board i/o pins
  3     returns const 0xaa55ff77       # don't count on this
  4     returns const 0xf0f0931a       # don't count on this

FYI, the "normal" python interface to the usrp is defined in gr-usrp/src/usrp1.i

> Thanks,
> Clark

Eric




reply via email to

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