Forum: GNU Radio setting registers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0eb8aaa0e5b2cb89e531aab16efca7cf?d=identicon&s=25 Zhuocheng Yang (Guest)
on 2007-07-16 22:01
(Received via mailing list)
Hi guys:

My name is Zhuocheng Yang, you can call me Leo. I am pretty new to
gnuradio, started working on it a month ago. Since Thibaud has gone back
to Switzerland, I will be taking over his work. I am currently trying to
process the control packets, but I am not sure how I can read/write to
registers. Can anyone tell me where the registers are and how I can
read/write to them?

Leo
79723aa1b24981dcec2dbf7fd59403c1?d=identicon&s=25 Brian Padalino (Guest)
on 2007-07-16 22:09
(Received via mailing list)
On 7/16/07, Zhuocheng Yang <zhuochen@andrew.cmu.edu> wrote:
> Hi guys:
>
> My name is Zhuocheng Yang, you can call me Leo. I am pretty new to gnuradio, started 
working on it a month ago. Since Thibaud has gone back to Switzerland, I will be taking 
over his work. I am currently trying to process the control packets, but I am not sure how 
I can read/write to registers. Can anyone tell me where the registers are and how I can 
read/write to them?

I believe setting_reg.v is instantiated wherever there is a register
which can be written to.  Being able to have access to every register
makes for a very hairy problem.  They are written to the FX2 over I2C
I am pretty sure.

Are there specific registers you want access to?  What is your final
goal?  Is there another way to perform what you want to do?

Brian
D0072e69d706bb3ca211d33a1b536e2c?d=identicon&s=25 Johnathan Corgan (Guest)
on 2007-07-16 22:14
(Received via mailing list)
Zhuocheng Yang wrote:

> Can anyone tell me where the registers are and how I can read/write
> to them?

Once you create a usrp.source_c() or usrp.sink_c() object, you can call:

u = usrp.source_c()

u._write_fpga_reg(regno, val)

The registers are write-only.  You may call:

u._read_fpga_reg(regno)

...but the return value will either be zero or a semi-documented set of
debugging values unrelated to the register number you put.

The register definitions are in:

usrp/firmware/include/fpga_regs_common.h
usrp/firmware/include/fpga_regs_standard.h

*** NOTE: it is possible to damage your hardware by incorrectly setting
these registers ***

--
Johnathan Corgan
Corgan Enterprises LLC
http://corganenterprises.com
Ac73d95c8ccddff9ecae369bcb80a923?d=identicon&s=25 George Nychis (Guest)
on 2007-07-16 22:19
(Received via mailing list)
So I think what Leo is getting at is how to actually perform the read or
the write to a register for the C/S packets.  For instance we have the
read/write register commands where the application says read from
register X or write this data to it.

This would pertain to OP_WRITE_REG, OP_WRITE_REG_MASKED, OP_READ_REG,
and OP_READ_REG_REPLY:
http://gnuradio.org/trac/browser/gnuradio/trunk/us...

I'm assuming what Leo is wondering, is when I pass him register 3 for
instance, how he can actually perform the read or write.

- George
79723aa1b24981dcec2dbf7fd59403c1?d=identicon&s=25 Brian Padalino (Guest)
on 2007-07-16 22:26
(Received via mailing list)
On 7/16/07, George Nychis <gnychis@cmu.edu> wrote:
> instance, how he can actually perform the read or write.
Major surgery.  Disconnect the I2C pins between the FX2 and the FPGA
logic (float the pins coming in, and ground the pin going out?).  Then
every register has to be put into a register file which the C/S state
machine has the ability to read/write, and create input ports for each
of the modules which have registers associated with them.

You may be able to use a spare pin connected to the FX2 to perform
some weird loopback thing where the host sends to FX2 which then sends
to the FPGA.  The FPGA notices it must write a register, so it sends a
special packet back to the FX2 which the FX2 parses after it reads (no
DMA here) and then performs the I2C write, but that is a big old mess
too.

Both are pretty involved modifications - at least that's my take on
the whole affair, which I could be completely wrong about.

Brian
3596cfe1d579c65b9babd35e8787977c?d=identicon&s=25 Matt Ettus (Guest)
on 2007-07-16 23:02
(Received via mailing list)
Brian Padalino wrote:
>>
>> I'm assuming what Leo is wondering, is when I pass him register 3 for
>> instance, how he can actually perform the read or write.
>
> Major surgery.  Disconnect the I2C pins between the FX2 and the FPGA
> logic (float the pins coming in, and ground the pin going out?).  Then
> every register has to be put into a register file which the C/S state
> machine has the ability to read/write, and create input ports for each
> of the modules which have registers associated with them.

FPGA registers are not set using I2C, they are set with SPI.  There is
already a mechanism for reading back values over SPI, but it is only set
up to read back 8 values now, mostly for reading io pins and rssi
levels, but not every register.  See serial_io.v and setting_reg.v

> You may be able to use a spare pin connected to the FX2 to perform
> some weird loopback thing where the host sends to FX2 which then sends
> to the FPGA.  The FPGA notices it must write a register, so it sends a
> special packet back to the FX2 which the FX2 parses after it reads (no
> DMA here) and then performs the I2C write, but that is a big old mess
> too.

No hardware modifications necessary
.

Matt
This topic is locked and can not be replied to.