Forum: GNU Radio Low speed ADC-DAC from Python ?

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.
533e669652a899ecd3b838295aef0837?d=identicon&s=25 Angilberto Muniz Sb (Guest)
on 2006-04-03 15:37
(Received via mailing list)
Folks,
Is it possible to read/write from/to the low speed
ADC/DAC from Python?

If possible, what would be a safe rate ?

Thankx,

Angilberto.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
745d8202ef5a58c1058d0e5395a78f9c?d=identicon&s=25 Eric Blossom (Guest)
on 2006-04-03 19:40
(Received via mailing list)
On Mon, Apr 03, 2006 at 06:34:24AM -0700, Angilberto Muniz Sb wrote:
> Folks,
> Is it possible to read/write from/to the low speed
> ADC/DAC from Python?

The python interfaces to the usrp are specified in
gr-usrp/src/usrp1.py.  Check usrp/host/lib/usrp_basic.h for the
missing documentation (sorry about that.  We've got a situation that's
violating the "write once" rule):


  //! magic value used on alternate register read interfaces
  static const int READ_FAILED = -99999;

  /*!
   * \brief Write auxiliary digital to analog converter.
   *
   * \param which_dboard	[0,1] which d'board
   *    			N.B., SLOT_TX_A and SLOT_RX_A share the same AUX DAC's.
   *          			SLOT_TX_B and SLOT_RX_B share the same AUX DAC's.
   * \param which_dac		[2,3] TX slots must use only 2 and 3.
   * \param value		[0,4095]
   * \returns true iff successful
   */
  bool write_aux_dac (int which_board, int which_dac, int value);

  /*!
   * \brief Read auxiliary analog to digital converter.
   *
   * \param which_dboard	[0,1] which d'board
   * \param which_adc		[0,1]
   * \returns value in the range [0,4095] if successful, else
READ_FAILED.
   */
  int read_aux_adc (int which_dboard, int which_adc);


So from python:

  d_board = 0   # 0: side A, 1: side B

  v = u.read_aux_adc(d_board, 0)
  ok = write_aux_dac(d_board, 2, 2048)

Be sure to pay attention to the comments above that start with N.B.
You may also want to take a look at the usrp schematics if this isn't
clear.


> If possible, what would be a safe rate ?

It's pretty slow.  You'll need to try it to see how fast it'll run on
your system.  Each read or write is a round trip across the USB, plus
bit banging the SPI bus to talk to the AD9862.  There's no clock
pacing the reads and writes of the the aux dac/adc's, so the samples
won't be evenly spaced.  Most daughterboards that use them, use them
for things like setting an analog gain control, or reading back an RSSI
indication.

Eric
533e669652a899ecd3b838295aef0837?d=identicon&s=25 Angilberto Muniz Sb (Guest)
on 2006-04-03 21:09
(Received via mailing list)
Perfect Eric.

Thank you for the details...

Angilberto.

--- Eric Blossom <eb@comsec.com> wrote:

> a situation that's
>    *
>   bool write_aux_dac (int which_board, int
>    */
>
> your system.  Each read or write is a round trip
>
> Eric
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
This topic is locked and can not be replied to.