<?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>PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7884/ppi-channel-used-to-generate-pulse-wave</link><description>Hi All, 
 I am using NRF51822 chip pca10001 development board. 
 I flashed ble_app_hrs application to the board. 
 I configure 3 channel for PPI. 
 static void ppi_init(void)
{
 
 uint32_t err_code;

 err_code = sd_ppi_channel_assign(0,
 &amp;amp;(NRF_TIMER2</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 08 Jul 2015 11:54:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7884/ppi-channel-used-to-generate-pulse-wave" /><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28165?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2015 11:54:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5be92a08-61ab-4dd7-9bc4-ad375e1d279c</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;Ok Aryan, i will try with latest PWM library and let you know.&lt;/p&gt;
&lt;p&gt;Regards
Punith&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28164?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2015 11:17:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3434211e-b43f-4519-b7c0-227150a7ac1c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;on nRF51, we were struggling a lot with it. In PWM missing one interrupt that toggles the pin would mean that the signal is inverted. This could happen with BLE events as they are running on higher priority. The link i sent you today the engineer tried his best to have a workaround with this to have a stable PWM output even in this cases. with nRF52 we do not have this problem.&lt;/p&gt;
&lt;p&gt;When you try to update the duty cycle, in GPIOTE interrupt handler if a TOGGLE is missed due to long BLE event that blocked it, it will invert the signal. In nRF52 there are seperate set and clear tasks that are used instead of toggle and even if we miss one set and clear then only one pusle is inverted and the rest will be ok&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28163?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2015 10:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbdafce6-aa6b-4f1f-a6ce-f50df6406a90</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;means with BLE is not possible to fix inverted PWM or what?.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28162?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2015 10:40:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38abc970-8ccc-4162-891e-812525e74860</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Punith, Inverted PWM output with BLE is a known thing. It is very difficult to completely remove it , but there is a PWM library that was just updated today to fix that problem. Maybe it will be useful for you.
&lt;a href="https://devzone.nordicsemi.com/question/39809/sometimes-pwm-signal-is-reversed/?answer=43078#post-id-43078"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28161?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2015 10:24:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c149a35-450d-49ad-99ec-caa43979a1bb</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;Hi Aryan.&lt;/p&gt;
&lt;p&gt;You meant to say with BLE main.c right?.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28160?ContentTypeID=1</link><pubDate>Wed, 08 Jul 2015 10:03:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44376758-aa5d-4329-a68e-37736fb23dd0</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;please give me your main.c file Punith, I want to replicate your problem here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28159?ContentTypeID=1</link><pubDate>Sat, 04 Jul 2015 05:18:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3dde18d0-0028-4bd2-b18b-4a613bdf8363</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;Yes i tried by using PPI register directly but that is also not working, for that what i did as fallows.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;For each ble interuppt i just first_event flag and i set one more flag in gpiote_interrupt handler.&lt;/li&gt;
&lt;li&gt;i enabled the ppi in main while loop  by checking gpio interrupt flag.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is my code in BLE.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   for (;;)
    {
				if(pwm_flag == true)
				{
					peripheral_init();
					pwm_flag = false;
				}
				if(nrf_gpio_pin_read(M_BUTTON_PIN) == 0)
				{
					button_config();
					//nrf_delay_ms(50);
				}
        app_sched_execute();
        power_manage();
    }
}

static void peripheral_init()
{
        nrf_gpio_pin_toggle(19);
				gpiote0_timer_dis();
        gpiote_channel_0_set();
        nrf_gpio_pin_clear(AC_OUT_PIN);
				NRF_TIMER2-&amp;gt;TASKS_CLEAR=1;
				//pwm_set(2);
				pwm_set(load.slide_value);
				NRF_TIMER2-&amp;gt;TASKS_START=1;
			  ppi_enable(); 
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in BLE interrupt i added fallowing lines.&lt;/p&gt;
&lt;p&gt;gpiote_channel_0_set();&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;										ppi_disable();
										NRF_TIMER2-&amp;gt;TASKS_STOP = 1;
										//ppi_enable();
										load.on_off = 1;
										load.slide_value = p_evt_write-&amp;gt;data[1];
										OneTime_gpiote_IRQ_f = true;
										NVIC_EnableIRQ(GPIOTE_IRQn);
									__enable_irq();
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In gpiote_interrupt handler has fallowing code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void GPIOTE_IRQHandler(void)
{
		uint32_t             err_code;
    // Event causing the interrupt must be cleared.
     if (NRF_GPIOTE-&amp;gt;EVENTS_IN[2] == 1)
    {
			
			if(OneTime_gpiote_IRQ_f == true)
			{
				nrf_gpio_pin_toggle(18);
				pwm_flag=true; 
				OneTime_gpiote_IRQ_f = false;
  			}
			
			NRF_GPIOTE-&amp;gt;EVENTS_IN[2] = 0;	
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I did same logic which is did without BLE, only change is i called pheripheral_init from main in BLE but that i called from GPIOTE_IRQhandler in without BLE.&lt;/p&gt;
&lt;p&gt;WIthout BLE if i keep on press the button i am getting constant PWM , there is no invert output.&lt;/p&gt;
&lt;p&gt;But with BLE getting inverted ouput some times, and Once you came from vacation , could you tell me what may the issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28158?ContentTypeID=1</link><pubDate>Fri, 03 Jul 2015 14:16:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e667272c-22b7-4998-9736-1e9012d05a34</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;can you try not using sd_ppi function and enable ppi directly using PPI registers. If it works then something is wrong in softdevice.
I am sorry for my late response, i am on vacation and wont be back to work until Monday.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28132?ContentTypeID=1</link><pubDate>Fri, 03 Jul 2015 10:11:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:775ec20c-36d2-4130-a0a1-6bb16c18e0bb</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;means by calling timer start and ppi_enable for first gpio 10ms interrupt. Now i am not getting toggle output. But with BLE i am facing fallowing issue.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;I cant able to use ppi_enable call in  gpio interrupt handler.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Always i need to call in BLE interrupt as fallows.&lt;/p&gt;
&lt;p&gt;ppi_enable();
NVIC_EnableIRQ(GPIOTE_IRQn);
__enable_irq();&lt;/p&gt;
&lt;p&gt;__inline void ppi_enable(void)
{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 	uint32_t err_code;
 	err_code = sd_ppi_channel_enable_set( (PPI_CHEN_CH0_Msk) | (PPI_CHEN_CH1_Msk)| (PPI_CHEN_CH2_Msk) | (PPI_CHEN_CH3_Msk)| (PPI_CHEN_CH4_Msk));

 APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Kindly let me know why i am not able to call ppi_enable in GPIOTE_IRQHandler.
if i call i am not getting any PWM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28131?ContentTypeID=1</link><pubDate>Fri, 03 Jul 2015 10:04:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:417ac755-4871-4ee1-ae7b-fecaa5123ff5</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;HI Aryan,&lt;/p&gt;
&lt;p&gt;Now i solved the toggle output by doing fallowing changes.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    static void peripheral_init()
{
			static int x=1;
			int xx;
          //nrf_gpio_pin_toggle(18);
				gpiote0_timer_dis();
        gpiote_init();
        gpio_event_config();
        nrf_gpio_pin_clear(AC_OUT_PIN);
				NRF_TIMER2-&amp;gt;TASKS_CLEAR=1;
				NRF_TIMER2-&amp;gt;TASKS_START=1;
			  ppi_enable(); 
				NRF_GPIOTE-&amp;gt;EVENTS_IN[3]=0;
				//NRF_GPIOTE-&amp;gt;EVENTS_IN[2]=0;
		
        
	}

void GPIOTE_IRQHandler(void)
{
    
    if(NRF_GPIOTE-&amp;gt;EVENTS_IN[3]==1)
    {
			nrf_gpio_pin_toggle(19);
					NRF_GPIOTE-&amp;gt;EVENTS_IN[3]=0;
         	first_event=true;				
					//peripheral_init();
				
    }
    if(NRF_GPIOTE-&amp;gt;EVENTS_IN[2]==1)
    {
                if(first_event == true)
								{
										peripheral_init();
										first_event=false;
										//NVIC_DisableIRQ(GPIOTE_IRQn);
								}
//										gpiote_init();
//							nrf_gpio_pin_clear(AC_OUT_PIN);
                NRF_GPIOTE-&amp;gt;EVENTS_IN[2]=0;
    }   
}

int main(void)
{
		nrf_gpio_cfg_input(20,GPIO_PIN_CNF_PULL_Pullup);
		nrf_gpio_cfg_input(16,GPIO_PIN_CNF_PULL_Pullup);
		gpio_event_config();
		nrf_gpio_cfg_output(AC_OUT_PIN);
		nrf_gpio_cfg_output(19);
	
		timer2_init();
		gpiote_init();
		ppi_init();
		nrf_gpio_pin_clear(AC_OUT_PIN);
	//	NRF_TIMER2-&amp;gt;TASKS_START=1;
	//	pwm_set(7);
		while (true)
    {
				//gpiote_init();
			
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28130?ContentTypeID=1</link><pubDate>Thu, 02 Jul 2015 09:45:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:208dbd66-7cbf-4567-bfc7-0d3bbb81eecd</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;Hi Aryan,&lt;/p&gt;
&lt;p&gt;I noticed that if i call gpiote_channel_0_set(); for every 10ms interrupt i am not getting toggle output.
Could you tell me what is issue?.&lt;/p&gt;
&lt;p&gt;Since i am using  PPI i dont want to use interrupt handler. then how to solve this without interrupt handler function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28134?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 10:52:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18d8201d-dcae-42ba-a702-7661f3b8d9a8</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;i think that is not necessary, because i probed 20th pin its giving constant inetrrupt.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28129?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 10:47:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b03b590c-ffaa-48c6-a36f-542aa8aec776</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;means generating 20th pin interrupt form other board.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28157?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 07:47:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8d58937-9d6e-41c2-9992-207069161452</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;can you test this on another board if you have any spare?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28156?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 07:07:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:442df8c9-b995-49ca-951f-6c5530d2957d</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;No I am getting inverted PWM for all CC0 value.  Previously i am wrong.
Now need to know how to solve inverted PWM.
My hardware generating interrupt  for every 10ms , there is no issue. thats why i am getting PWM width as 10ms.
So gpio interrupt is not an issue, but how to solve inverted PWM issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28155?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 06:35:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa755530-1831-48db-b27a-0765637fe95d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I have a Logic Analyzer connected to the output and it samples it at 16MHz speed. &lt;a href="http://support.saleae.com/hc/en-us"&gt;support.saleae.com/.../en-us&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28154?ContentTypeID=1</link><pubDate>Wed, 01 Jul 2015 05:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67ff3bdd-3ad6-468b-9e24-ec711282e563</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;How you ensured PWM is constant. Is by probing?.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28153?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 15:16:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e908adf-a6fd-481d-8518-7c162e39ed49</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;i tested this by driving pin20 from other device, it is strange that i do not see the inverted output. I am not sure why it is different at both ends. I suggest you to rip off code until you find it.
start with removing LED togglings, check if one of the peripheral initialization in peripheral_init is causing it. I am not sure how more i can help you if you cannot share your project and I cannot reproduce it here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28152?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 14:37:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48356b24-3516-4d90-a11d-bb4ed1ca2c72</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;i pointed one more thing that  if CC[0]&amp;lt;5000 i am getting constant PWM but if i give CC[0] &amp;gt; 5000 , i am getting inverted PWM.&lt;/p&gt;
&lt;p&gt;This is an strange issue. Kindly let me know the problem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28151?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 13:40:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3516ff6a-974d-4139-8553-77a175d77bfe</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;why dont you test by driving 20th pin by other device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28150?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 13:37:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aff1196f-d90f-48b8-8602-48d9bd43c666</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;in your attached main.c i only removed the lines in while(true) loop but i am getting inverted ouputs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28149?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 12:39:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74265ed4-c03e-4c8e-98c9-5d39ac2d0559</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;attached my main.c in my answer. I tested it and it did not change output.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28147?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 12:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d0520bc-a1b6-4d19-9030-3cbe61ff748f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I have got an idea, i will drive the pin20 from another slave, i will try this out&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28148?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 12:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:028bd51c-ef61-480a-92a3-7d56b0079895</guid><dc:creator>Fab1223</dc:creator><description>&lt;p&gt;static bool first_event i made as global variable and then did as per your logic there also getting inverted PWM&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PPI CHANNEL USED TO generate pulse wave</title><link>https://devzone.nordicsemi.com/thread/28146?ContentTypeID=1</link><pubDate>Tue, 30 Jun 2015 12:04:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a0ddae5-f794-44d6-99d7-398bf0e92abe</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;try this&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void peripheral_init()
{
	      nrf_gpio_pin_toggle(18);
        NRF_GPIOTE-&amp;gt;EVENTS_IN[3]=0;
        gpiote0_timer_dis();    
        gpiote_channel_0_set();
        gpiote_init();
        timer2_init();
        ppi_init();
        nrf_gpio_pin_clear(AC_OUT_PIN);
        NRF_TIMER2-&amp;gt;TASKS_START=1;
}

void GPIOTE_IRQHandler(void)
{
	static bool first_event = true;
    if(NRF_GPIOTE-&amp;gt;EVENTS_IN[3]==1)
    {
       peripheral_init();
    }
    if(NRF_GPIOTE-&amp;gt;EVENTS_IN[2]==1)
    {
	   if(first_event)
	   {
	     first_event = false;
         peripheral_init();
       }
      nrf_gpio_pin_toggle(19);
      NRF_GPIOTE-&amp;gt;EVENTS_IN[2]=0;
   }   
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>