discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Low speed ADC-DAC from Python ?


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Low speed ADC-DAC from Python ?
Date: Mon, 3 Apr 2006 10:37:11 -0700
User-agent: Mutt/1.5.9i

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




reply via email to

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