On Mon, Feb 24, 2025 at 10:42 AM <kavin...@atindriya.co.in> wrote:

> Hi,
>    I have written a c code for GPIO toggling in USRP B205mini-i board.
> The pin should be high for 1microseconds and low for 1milliseconds. I
> have given the c code to verify whether it is correct or not?
>
>      while(1)
>      {
>          uhd_usrp_get_time_now(usrp, mboard, &full_secs, &frac_secs);
>          uhd_usrp_set_command_time(usrp, full_secs , frac_secs + 1e-6,
> mboard);
>

This won't work, you need to set this in the future from "time now".

         error = uhd_usrp_set_gpio_attr(usrp, bank, "OUT", 0x01, mask1,
> mboard);
>          uhd_usrp_clear_command_time(usrp, 0);
>          uhd_usrp_get_time_now(usrp, mboard, &full_secs, &frac_secs);
>          uhd_usrp_set_command_time(usrp, full_secs , frac_secs + 1e-3,
> mboard);
>

Same here.


>          error = uhd_usrp_set_gpio_attr(usrp, bank, "OUT", 0x00, mask1,
> mboard);
>          uhd_usrp_clear_command_time(usrp, 0);
>      }
>

Get the time "now" outside of the loop, and use that as a base reference.
When you've fixed that, I recommend you connect it to an oscilloscope for
verification.

--M
_______________________________________________
USRP-users mailing list -- usrp-users@lists.ettus.com
To unsubscribe send an email to usrp-users-le...@lists.ettus.com

Reply via email to