[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-24 Thread Martin Braun
Assuming t_high is a uhd::time_spec_t that marks the start time of your HIGH state, simply do auto t_low = t_high + 1e-6; and then use t_low for your second timed command: usrp->set_command_time(t_high); usrp->set_gpio_attr(/* set your pin high */); usrp->set_command_time(t_low); usrp->set_gpio_

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-24 Thread kavinraj
Hi, 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); error = uhd_usrp_set_gpio_attr(usrp, bank, "OUT", 0x01, mask1, mboard); uhd_usrp_clear_command_time(usrp,

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-24 Thread kavinraj
Hi, What is the minimum time to toggle the GPIO pin? I want to make the GPIO pin high for 1microsecond and low for 1milliseconds. How i achieve this through code? Thanks. On 2025-02-24 01:57, Martin Braun wrote: You don't specify a delay, you send one timed command to make the pin go H

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-23 Thread Martin Braun
You don't specify a delay, you send one timed command to make the pin go HIGH, and another timed command to make it go LOW. And the two command-times should be "your delay" apart. This may help: https://www.youtube.com/watch?v=ppD06ZETnek&t=75s&pp=ygUPZ3Jjb24gdXNycCBncGlv --M On Sat, Feb 22, 202

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-22 Thread kavinraj
Hi, How to give the delay in uhd_usrp_set_command_time(uhd_usrp_handle h,int64_t full_secs,double frac_secs,size_t mboard) function? On 2025-02-22 00:10, Marcus D. Leech wrote: On 21/02/2025 23:56, kavin...@atindriya.co.in wrote: Hi,   Can I use usleep(1) or any other technique is t

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-21 Thread Marcus D. Leech
On 21/02/2025 23:56, kavin...@atindriya.co.in wrote: Hi,   Can I use usleep(1) or any other technique is there for GPIO . You might be able to use timed commands: https://files.ettus.com/manual/page_timedcmds.html#timedcmds_gen_cmds But since usleep() cannot guarantee any kind of maximum peri

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-21 Thread kavinraj
Hi, Can I use usleep(1) or any other technique is there for GPIO . On 2025-02-21 23:37, Marcus D. Leech wrote: On 21/02/2025 23:22, kavin...@atindriya.co.in wrote: Hi,  Thanks for answering.  Can you explain me clearly? Thanks. I'd suggest, at a minimum, looking at the MAN page for usleep(

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-21 Thread Marcus D. Leech
On 21/02/2025 23:22, kavin...@atindriya.co.in wrote: Hi,  Thanks for answering.  Can you explain me clearly? Thanks. I'd suggest, at a minimum, looking at the MAN page for usleep(). On 2025-02-21 23:11, Marcus D. Leech wrote: On 21/02/2025 23:05, kavin...@atindriya.co.in wrote: Hi,    I

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-21 Thread kavinraj
Hi, Thanks for answering. Can you explain me clearly? Thanks. On 2025-02-21 23:11, Marcus D. Leech wrote: On 21/02/2025 23:05, kavin...@atindriya.co.in wrote: Hi,    In USRP B205mini-i I am able to access the GPIO Pin. I have to create a Pulse in the GPIO pin. I want to make high the gpio

[USRP-users] Re: REG : GPIO in USRP B205Mini

2025-02-21 Thread Marcus D. Leech
On 21/02/2025 23:05, kavin...@atindriya.co.in wrote: Hi,    In USRP B205mini-i I am able to access the GPIO Pin. I have to create a Pulse in the GPIO pin. I want to make high the gpio pin for 1microsecond and low for 999microseconds. How to achieve this timings through coding. Can you give me

[USRP-users] Re: REG: GPIO in USRP B205mini

2025-01-27 Thread Martin Braun
The mask affects the bits that you actually write to the attribute. In this case: uhd_usrp_set_gpio_attr(usrp, bank, "DDR", 1, 0x02, mboard); ...you're setting the DDR register to 0x01 and the mask to 0x02. 0x01 & 0x02 == 0, so you're not setting anything. This works: uhd_usrp_set_gpio_attr(usr