<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>pulse generation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18064/pulse-generation</link><description>Hello, I work with some ADC 24-bit (HX711) and for getting data from that I need after low level on first gpio pin to fed 26 pulses to that with time period about 1us on second gpio pin and simultaneously getting data on first gpio pin. 
 For detect</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Dec 2016 05:24:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18064/pulse-generation" /><item><title>RE: pulse generation</title><link>https://devzone.nordicsemi.com/thread/69666?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2016 05:24:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c2c57fd-069f-411d-bf41-7cb608c540e4</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Thanks. I have some problem with triggering pwm sequence task by ppi
here is my question &lt;a href="https://devzone.nordicsemi.com/question/105425/pwm-driver-gpiote-ppi/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pulse generation</title><link>https://devzone.nordicsemi.com/thread/69665?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2016 11:55:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f4a15a1-827f-4c0a-a229-29a4a41ebee6</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Yes, you dont need to call the whole function. How often do you need the function? You could split a large part of the code into a init-part, and then call the &lt;code&gt;nrf_drv_pwm_simple_playback&lt;/code&gt; in the event handler. If you use the function very often it could be worth looking into using PPI. Here is a post on &lt;a href="https://devzone.nordicsemi.com/question/76996/nrf52-1-4-mhz-clock-needed/"&gt;that&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pulse generation</title><link>https://devzone.nordicsemi.com/thread/69667?ContentTypeID=1</link><pubDate>Thu, 01 Dec 2016 07:09:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb3cab57-87a0-42f8-9728-4b974d45a827</guid><dc:creator>Stas</dc:creator><description>&lt;p&gt;Thank you. This function is works for me. The following task would be to start this pulse sequince after trigger low level on other pin. But I think it&amp;#39;s not correct to call this whole function from gpiote event handle?! I know the best way would be to use PPI, but I never used it before&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pulse generation</title><link>https://devzone.nordicsemi.com/thread/69664?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2016 12:57:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87666bbe-8e23-4a54-8bc1-46ab4c4dccee</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For generating a fixed number of pulses, I suggested using the PWM driver(nRF52 only).&lt;/p&gt;
&lt;p&gt;Here is a function called &lt;code&gt;generate_pulse_1mhz(uint16_t pulses,uint8_t pin_number)&lt;/code&gt;, it takes the number of 1 Mhz pulses you want to generate and the output pin number. When called it will output the desired number of pulses on the pin specified.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static nrf_drv_pwm_t m_pwm0 = NRF_DRV_PWM_INSTANCE(0);

static void generate_pulse_1mhz(uint16_t pulses,uint8_t pin_number)
{
    uint32_t err_code;
    nrf_drv_pwm_config_t const config0 =
    {
        .output_pins =
        {
            pin_number,                           // channel 0
            NRF_DRV_PWM_PIN_NOT_USED,             // channel 1
            NRF_DRV_PWM_PIN_NOT_USED,             // channel 2
            NRF_DRV_PWM_PIN_NOT_USED,             // channel 3
        },
        .irq_priority = APP_IRQ_PRIORITY_HIGH,
        .base_clock   = NRF_PWM_CLK_2MHz,
        .count_mode   = NRF_PWM_MODE_UP,
        .top_value    = 2,
        .load_mode    = NRF_PWM_LOAD_COMMON,
        .step_mode    = NRF_PWM_STEP_AUTO
    };
    err_code = nrf_drv_pwm_init(&amp;amp;m_pwm0, &amp;amp;config0, NULL);
    APP_ERROR_CHECK(err_code);
    
    static uint16_t /*const*/ seq_values[] ={1};
    
    nrf_pwm_sequence_t const seq =
    {
        .values.p_common = seq_values,
        .length          = NRF_PWM_VALUES_LENGTH(seq_values),
        .repeats         = 0,
        .end_delay       = 0
    };
    
    nrf_drv_pwm_simple_playback(&amp;amp;m_pwm0, &amp;amp;seq, pulses,  NRF_DRV_PWM_FLAG_STOP);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>