<?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>generating the frequency of 1MHZ  on nrf52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69863/generating-the-frequency-of-1mhz-on-nrf52832</link><description>Hello, 
 I want to learn how we generate the frequency on nrf52832. I simply take a Blinky led example and on that blinking the led. i want 1MHZ frequency . so how should i proceed for???</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Dec 2020 17:59:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69863/generating-the-frequency-of-1mhz-on-nrf52832" /><item><title>RE: generating the frequency of 1MHZ  on nrf52832</title><link>https://devzone.nordicsemi.com/thread/286765?ContentTypeID=1</link><pubDate>Mon, 28 Dec 2020 17:59:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:242c54fb-99b0-47ce-804b-d453e49d7e2c</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Sunil,&lt;/p&gt;
&lt;p&gt;There are at least three ways to satisfy your need. I assume that you need a 1MHZ 50%duty PWM wave.&lt;/p&gt;
&lt;p&gt;1. GPIO toggle + 0.5us dealy, basically like the blinky led example, but the delay function is not accurate, it is hard to achieve 1MHz accurately.&lt;/p&gt;
&lt;p&gt;2. GPIOE + PPI + Timer, nrf52DK examples\peripheral\gpiote shows exactly how to do this. Just modify the following lines.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;...
nrf_drv_timer_extended_compare(&amp;amp;timer, (nrf_timer_cc_channel_t)0, 1, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);
...
nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
timer_cfg.frequency = NRF_TIMER_FREQ_2MHz;
...
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;3. using PWM peripheral. See the example&amp;nbsp;examples\peripheral\pwm_driver.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>