<?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 clock on GPIO</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83456/generating-clock-on-gpio</link><description>Hi team, 
 I am trying to generate pulses on a GPIO using timer1. The pulse need not to be very accurate. 
 To start with I used the below given code to generate a clock frequency of 1.6 MHz. 
 /* Start 16 MHz crystal oscillator */ NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Jan 2022 14:30:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83456/generating-clock-on-gpio" /><item><title>RE: generating clock on GPIO</title><link>https://devzone.nordicsemi.com/thread/346725?ContentTypeID=1</link><pubDate>Fri, 07 Jan 2022 14:30:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6709ccd-787a-425e-ac38-f94f0f27a691</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Any read access to the peripheral bus will stall the processor until the transfer is completed, and I guess that is part of the reason you only get 347 KHz. The nrf_gpio_pin_toggle() is also relatively slow as it first reads the current output state before writing the new state. It would be faster if you used a GPIOTE toggle task for this (&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52810/gpiote.html?cp=4_5_0_5_8_3_7#register.CONFIG-0-7"&gt;CONFIG[n]&lt;/a&gt;&lt;/span&gt;).&lt;/p&gt;
&lt;p&gt;I can help set up a sample with PPI if that&amp;#39;s of interest.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>