discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Re: TTL I/O signals through DBS_RX board


From: Matt Ettus
Subject: [Discuss-gnuradio] Re: TTL I/O signals through DBS_RX board
Date: Mon, 23 Jan 2006 16:10:14 -0800
User-agent: Thunderbird 1.5 (X11/20051201)

>> All of the pins on J24 and J25 are available except for io_rx[0].
>> I would use the ones on the high end of J25 first.  There is code
>> to control the pins.  First you need to make the desired pin an
>> output by setting the corresponding oe to a 1.
>> 
>> 
>> usrp._write_oe(which, OE, MASK)
>> 
>> Then you can control the pin with
>> 
>> usrp.write_io(which, OUTPUT, MASK)

> Could you give a concrete example?  Let's say I want to turn on one
> of the free bits on J25, what would I do?  I know that "which" is the
> daughtercard slot, but how are OE, MASK, and OUTPUT used?

mask is a bitmask controlling what bits are affected by the operation.
So let say you want to make bit 15 into an output, you would do

        usrp._write_oe(which, (1<<15), (1<<15))

to make it back into an input, you would do

        usrp._write_oe(which, 0, (1<<15))

You could do more than one bit at a time by changing the mask.  A mask
of 0xFFFF means to make the operation affect all 16 bits.

To make the output into a 1, do

        usrp.write_io(which, (1<<15), (1<<15))

To make it a 0, do

        usrp.write_io(which, 0, (1<<15))


To read back values (which will read both inputs and outputs), do

        data = usrp.read_io(which)


Matt




reply via email to

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