[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] Writing To An IO FPGA Register
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] Writing To An IO FPGA Register |
Date: |
Mon, 9 Feb 2009 19:04:47 -0800 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Mon, Feb 09, 2009 at 09:56:43PM -0500, Ben Perry wrote:
> So I am using higher-level interfaces to write to these registers.
> Namely I am concerned with writing to the output enable register for
> RxA. From my understanding of what I have to do I set up my source_c
> and then I am able to write_oe/io with a value to either 0 for a? and
> 1 for b?. My code is below:
>
> result = u._read_fpga_reg(usrp.FR_OE_1)
> print result
> result = (result | 0xFC<<8)
> print u._write_oe(0,result,result)
> print u._read_fpga_reg(usrp.FR_OE_1)
>
> This is for an RFX2400 d'board so I should have access to the 8-topmost bits.
>
> When I read the initial value in FR_OE_1 (RxA) I get 31 and after I
> write the desired write_oe and read it back I get 32. All return
> values are obviously in decimal. Any help would be appreciated.
Virtually none of the FPGA registers may be read back. In fact, none
of the ones that you can write can be read, thus your test is ill-founded.
You are correct about 0 of A, 1 for B.
Try this for side A:
u._write_oe(0, 0xfc00, 0xfc00)
i = 0
while 1:
u.write_io(0, i << 12, 0xfc00)
i = (i + 1) & 0xff
and look at the pins with an oscope.
Eric