discuss-gnuradio
[Top][All Lists]
Advanced

[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 07:53:46 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Feb 09, 2009 at 01:06:36AM -0500, Ben Perry wrote:
> I am trying to write to an IO register on my FPGA to open the lines of
> communication. Right now I am just using benchmark_tx.py as my test
> case.
> 
> In transmit_path.py I added the following
> 
> self.u._write_fpga_reg(usrp.FR_OE_1,4227922944)
> self.u._write_fpga_reg(usrp.FR_IO_1,4227922944)
> 
> I based this off of code I saw in other places, however I am getting
> an error. My error is below:
> 
> Traceback (most recent call last):
>   File "./benchmark_tx.py", line 138, in <module>
>     main()
>   File "./benchmark_tx.py", line 102, in main
>     tb = my_top_block(mods[options.modulation], options)
>   File "./benchmark_tx.py", line 42, in __init__
>     self.txpath = transmit_path(modulator, options)
>   File 
> "/home/ben/Desktop/gnuradio/gnuradio-examples/python/digital/transmit_path.py",
> line 68, in __init__
>     self._setup_usrp_sink()
>   File 
> "/home/ben/Desktop/gnuradio/gnuradio-examples/python/digital/transmit_path.py",
> line 119, in _setup_usrp_sink
>     self.u._write_fpga_reg(usrp.FR_OE_1,4227922944)
>   File "/usr/local/lib/python2.5/site-packages/gnuradio/usrp/usrp_swig.py",
> line 2254, in _write_fpga_reg
>     return _usrp_swig.usrp_sink_c_sptr__write_fpga_reg(*args, **kwargs)
> TypeError: in method 'usrp_sink_c_sptr__write_fpga_reg', argument 3 of
> type 'int'
> 
> Any help with this would be appreciated.
> 
> Also, I am new to Python. Is 0xFC00FC00 also correct for the register value?

Uhh, why are you trying to directly write these particular low-level
registers?  There's a high-level interface to write these.
Take a look at usrp_basic.h (and while you're at it, usrp_standard.h).

Independent of that, your problem is that 4227922944 is too big to fit
in a signed int.  Try gru.hexint(0xfc00fc00).





reply via email to

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