discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Firmware issue: Send a constant signal with the x


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Firmware issue: Send a constant signal with the xcvr2450 dboard
Date: Wed, 15 Sep 2010 22:49:57 -0700
User-agent: Mutt/1.5.20 (2009-12-10)

On Wed, Sep 15, 2010 at 05:55:12PM +0200, Matthias Schäfer wrote:
>  Hi List,
> I'm currently working on a standalone firmware app for USRP2. My
> goal is to send a constant signal with the xcvr2450 dboard. I
> skipped the tuning via firmware by doing this prior from a host
> using the simple_usrp c++ interface:
> 
> uhd::usrp::simple_usrp::sptr sdev = uhd::usrp::simple_usrp::make(args);
> uhd::device::sptr dev = sdev->get_device();
> sdev->set_tx_rate(rate);
> sdev->set_tx_freq(freq);
> sdev->set_tx_gain(gain);
> 
> ===============
> So back to the firmware. Assuming the tuning of the dboard is
> properly done from host, I basically understood the way sending is
> done as follows:
> 
> 1. Wait for the buffer pool to become idle:
> 
> while((buffer_pool_status->status & BPS_IDLE(DSP_TX_BUF_0)) == 0)
>     ;
> 
> 2. Copy the data which should be send to the DSP into the DSP tx-buffer:
> 
> uint32_t *p = buffer_ram(DSP_TX_BUF_0);
> uint32_t sample = (32000 << 16) | 0; // for example
> for (i = 0; i < BP_NLINE; i++) {
>     p[i] = sample;
> }
> 
> 3. Send the data to the DSP:
> 
> bp_send_from_buf(DSP_TX_BUF_0, PORT_DSP, 1, 0, BP_LAST_LINE);
> 
> 4. Wait until transaction is done or an error occured
> 
> while((buffer_pool_status->status & (BPS_DONE(DSP_TX_BUF_0) |
> BPS_ERROR(DSP_TX_BUF_0))) == 0)
>         ;
> 
> 5. Clear the status flags and redo the whole procedure
> 
> bp_clear_buf(DSP_TX_BUF_0);
> // goto 1.
> 
> ===============
> 
> Unfortunately this doesn't work for me like expected. I tried it in
> several variations and listened with another usrp2 for a signal but
> nothing happens. I think I understood something wrong and forgot
> something but it's hard for me to see the problem.
> 
> So maybe you guys can help me out with that.
> 
> Thanks in advance!
> 
> Cheers,
> Matthias

A couple of things.  32000 is likely to be too big and will probably
result in clipping.  Try 3200 to start with.

It's unlikely that f/w can write samples to the buffer fast enough to
keep the data streaming. However in your case, you only need to
initialize the samples in the buffer once, then you can just keep
sending it over and over.  

Do (2) once.

// Start in known good state (IDLE)
bp_clear_buf(DSP_TX_BUF_0);

// start first buffer xfer
bp_send_from_buf(DSP_TX_BUF_0, PORT_DSP, 1, 0, BP_LAST_LINE);

while (1){

  // wait for xfer to complete
  while ((buffer_pool_status->status &
          (BPS_DONE(DSP_TX_BUF_0) | BPS_ERROR(DSP_TX_BUF_0))) == 0)
    ;

  // Reset flags
  bp_clear_buf(DSP_TX_BUF_0);

  // start next xfer
  bp_send_from_buf(DSP_TX_BUF_0, PORT_DSP, 1, 0, BP_LAST_LINE);
}


Eric



reply via email to

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