<?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>there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3578/there-is-interference-in-pins-used-as-output-when-i-use-ble</link><description>Hello, 
 I am using a nrf51422 development kit with softdevice S310 and I have a problem in whatever pin I choose as output when I use the bluetooth. 
 I run the example ble_app_hts for nrf51822 but conditioned to be flashed in nrf51422. In this example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Aug 2014 17:39:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3578/there-is-interference-in-pins-used-as-output-when-i-use-ble" /><item><title>RE: there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/thread/12974?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 17:39:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a84619bf-1b48-444c-a544-e43d7886c749</guid><dc:creator>CesarBV</dc:creator><description>&lt;p&gt;and this is my code for timer to generate pwm&lt;/p&gt;
&lt;p&gt;//Define para TIMER&lt;/p&gt;
&lt;p&gt;#define PWM_OUTPUT_PIN_NUMBER  (25)&lt;/p&gt;
&lt;p&gt;#define MAX_SAMPLE_LEVELS (256UL)     /&lt;strong&gt;&amp;lt; Maximum number of sample levels. */
#define TIMER_PRESCALERS 6U           /&lt;/strong&gt;&amp;lt; Prescaler setting for timer. */
#define GPIOTE_CHANNEL_NUMBER_2        1&lt;/p&gt;
&lt;p&gt;///// TIMER /////&lt;/p&gt;
&lt;p&gt;static __INLINE uint32_t next_sample_get(void)
{
static uint32_t sample_value = 8;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Read button input.
sample_value = ((/*nrf_gpio_port_read(NRF_GPIO_PORT_SELECT_PORT0)*/0x000000BF) &amp;amp; 0x000000FFUL); // valor del ciclo de trabajo

// This is to avoid having two CC events happen at the same time,
// CC1 will always create an event on 0 so CC0 and CC2 should not.
if (sample_value == 0) 
{
    sample_value = 8;
}

return (uint32_t)sample_value;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/** @brief Function for handling timer 2 peripheral interrupts.
*/
void TIMER2_IRQHandler(void)
{
static bool cc0_turn = false; /**&amp;lt; Keeps track of which CC register to be used. */&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if ((NRF_TIMER2-&amp;gt;EVENTS_COMPARE[1] != 0) &amp;amp;&amp;amp; 
   ((NRF_TIMER2-&amp;gt;INTENSET &amp;amp; TIMER_INTENSET_COMPARE1_Msk) != 0))
{
    // Sets the next CC1 value
    NRF_TIMER2-&amp;gt;EVENTS_COMPARE[1] = 0;
    NRF_TIMER2-&amp;gt;CC[1]             = (NRF_TIMER2-&amp;gt;CC[1] + MAX_SAMPLE_LEVELS);

    // Every other interrupt CC0 and CC2 will be set to their next values.
    uint32_t next_sample = next_sample_get();

    if (cc0_turn)
    {
        NRF_TIMER2-&amp;gt;CC[0] = NRF_TIMER2-&amp;gt;CC[1] + next_sample;
    }
    else
    {
        NRF_TIMER2-&amp;gt;CC[2] = NRF_TIMER2-&amp;gt;CC[1] + next_sample;
    }
    // Next turn the other CC will get its value.
    cc0_turn = !cc0_turn;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;/** @brief Function for initializing the Timer 2 peripheral.
*/
static void timer2_init(void)
{
// Start 16 MHz crystal oscillator .
NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED  = 0;
NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART     = 1;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wait for the external oscillator to start up.
while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0) 
{
    //Do nothing.
}

NRF_TIMER2-&amp;gt;MODE        = TIMER_MODE_MODE_Timer;
NRF_TIMER2-&amp;gt;BITMODE     = TIMER_BITMODE_BITMODE_16Bit &amp;lt;&amp;lt; TIMER_BITMODE_BITMODE_Pos;
NRF_TIMER2-&amp;gt;PRESCALER   = TIMER_PRESCALERS;

// Clears the timer, sets it to 0.
NRF_TIMER2-&amp;gt;TASKS_CLEAR = 1;

// Load the initial values to TIMER2 CC registers.
NRF_TIMER2-&amp;gt;CC[0] = MAX_SAMPLE_LEVELS + next_sample_get();
NRF_TIMER2-&amp;gt;CC[1] = MAX_SAMPLE_LEVELS;

// CC2 will be set on the first CC1 interrupt.
NRF_TIMER2-&amp;gt;CC[2] = 0;

// Interrupt setup.
NRF_TIMER2-&amp;gt;INTENSET = (TIMER_INTENSET_COMPARE1_Enabled &amp;lt;&amp;lt; TIMER_INTENSET_COMPARE1_Pos);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}
///// TIMER /////&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/thread/12973?ContentTypeID=1</link><pubDate>Fri, 29 Aug 2014 17:37:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:967ecc7d-88d3-48a0-842c-23162373793d</guid><dc:creator>CesarBV</dc:creator><description>&lt;p&gt;I&amp;#39;ve decided to use a PWM generated with timer interrupts to generate the signal I need for LCD. To do this I have modified the example &amp;quot;pwm_example&amp;quot; (eliminating the part of reading buttons) and added to my code above. But now doesn&amp;#39;t work nothing, I have no signal in no any pin. So my question is the next, is there a problem between the configuration of the timers??? because I need one timer for pwm and BLE needs one timer too...&lt;/p&gt;
&lt;p&gt;This is my code for the timers configuration&lt;/p&gt;
&lt;p&gt;For timer used by BLE&lt;/p&gt;
&lt;p&gt;#define APP_TIMER_PRESCALER             0                                           /&lt;strong&gt;&amp;lt; Value of the RTC1 PRESCALER register. */
#define APP_TIMER_MAX_TIMERS            2                                           /&lt;/strong&gt;&amp;lt; Maximum number of simultaneously created timers. */
#define APP_TIMER_OP_QUEUE_SIZE         4                                           /**&amp;lt; Size of timer operation queues. */&lt;/p&gt;
&lt;p&gt;static void timers_init(void)
{
// Initialize timer module, making it use the scheduler
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, true);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/thread/12972?ContentTypeID=1</link><pubDate>Sun, 24 Aug 2014 06:22:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e495400-17ac-4252-b599-103d51729d98</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;You can know when softdevice will take over cpu time with radio notification event &lt;a href="https://devzone.nordicsemi.com/question/15121/radio-notification-only-after-ble-radio/?answer=15128#post-id-15128"&gt;devzone.nordicsemi.com/.../&lt;/a&gt; and don&amp;#39;t update LCD if you don&amp;#39;t have enough time to perform LCD update.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/thread/12976?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2014 22:39:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1aa593e-705c-47bf-adde-d05696e7cd29</guid><dc:creator>CesarBV</dc:creator><description>&lt;p&gt;Thanks, I&amp;#39;ll check it out and I&amp;#39;ll comment here the results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/thread/12971?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2014 22:38:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0737c017-6d65-4fd8-be64-feb2901a4517</guid><dc:creator>CesarBV</dc:creator><description>&lt;p&gt;I need a signal to control a LCD display, that is the reason because I need to eliminate the latency. When latency is present, the icons in the display are flashing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/thread/12970?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2014 21:22:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24f7d86a-acff-4ff7-8260-82cb7c61cc37</guid><dc:creator>CesarBV</dc:creator><description>&lt;p&gt;so, that means that this latency is not possible to eliminate????&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/thread/12975?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2014 10:34:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5523d1da-9b19-49ea-abd7-5f407e93d1d3</guid><dc:creator>Janek Mann</dc:creator><description>&lt;p&gt;You can likely achieve the effect you are aiming for (a stable clock output on a pin) using the timer peripheral, you can look at the pwm library for inspiration: &lt;a href="https://github.com/NordicSemiconductor/nrf51-pwm-library"&gt;github.com/.../nrf51-pwm-library&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: there is interference in pins used as output when I use BLE ???</title><link>https://devzone.nordicsemi.com/thread/12969?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2014 05:04:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0d06d26-65c5-4988-956b-43b4d1ef3431</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Read more about how softdevice works in &lt;a href="https://www.nordicsemi.com/eng/nordic/Products/nRF51822/S110-SDS/20338"&gt;S110_SoftDevice_Specification_v1.3A.pdf&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s because softdevice managing your advertising and every advertising event CPU goes from the main to the softdevice to send advertising packets so you some latency in the main.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>