Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5460

SDK • Re: how use gpio delay time microseconds ?

$
0
0
thank's how use it ? in documentation we have static fonction:
https://github.com/raspberrypi/pico-sdk ... c#L40-L119

Code:

uint delay_cyc = configured_freq[clk_sys] / configured_freq[clock] + 1;69busy_wait_at_least_cycles(delay_cyc * 3);
how defined correctyl delay_cyc ?

alternative i try this:

Code:

#include "pico/stdlib.h"int main() {    const uint LED_PIN = 0; // GPIO25    gpio_init(LED_PIN);    gpio_set_dir(LED_PIN, GPIO_OUT);    while (true) {        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 1);        gpio_put(LED_PIN, 0);        sleep_ms(1);    }}
in my oscilloscope I have 50 nanoseconde in hight output , if i want 100 ns I will gpio_put in loop in out rp2350 pico2?
is a good idea ?

Image

Statistics: Posted by keokod — Mon Dec 02, 2024 4:12 pm



Viewing all articles
Browse latest Browse all 5460

Trending Articles