This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

there is interference in pins used as output when I use BLE ???

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, it is implemented a health thermometer profile and it works fine, but I've added to this code a little code to generate a clock signal and to send it to an output pin. The clock pulse works fine when I eliminate the "advertising_start()" line, but I can not connect with bluetooth when I eliminate it, obviously. But when advertising_start() is running, the clock pulse doesn't work fine, some times it stays high or low more time than needed.

So, someone can tell me why when bluetooth is working, there is interference in the output signal??? my code is the next:


int main(void)

{

// Initialize.
leds_init();
timers_init();
gpiote_init();
buttons_init();

ble_stack_init();
bond_manager_init();
gap_params_init();

advertising_init();
services_init();

sensor_sim_init();
conn_params_init();
sec_params_init();

// Start execution.
application_timers_start();
advertising_start();

// Enter main loop.
int contador=1;
for (;;)
{
    //power_manage();
		
		if (contador%2==1)
		{
			nrf_gpio_cfg_output(SALIDA);
			nrf_gpio_pin_set(SALIDA);
		}
		else
		{
			nrf_gpio_cfg_output(SALIDA);
			nrf_gpio_pin_clear(SALIDA);
		}
		contador++;
}

}

Parents
  • Read more about how softdevice works in S110_SoftDevice_Specification_v1.3A.pdf.

    It'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.

  • I'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 "pwm_example" (eliminating the part of reading buttons) and added to my code above. But now doesn'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...

    This is my code for the timers configuration

    For timer used by BLE

    #define APP_TIMER_PRESCALER 0 /< Value of the RTC1 PRESCALER register. */ #define APP_TIMER_MAX_TIMERS 2 /< Maximum number of simultaneously created timers. */ #define APP_TIMER_OP_QUEUE_SIZE 4 /**< Size of timer operation queues. */

    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);

    }

Reply
  • I'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 "pwm_example" (eliminating the part of reading buttons) and added to my code above. But now doesn'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...

    This is my code for the timers configuration

    For timer used by BLE

    #define APP_TIMER_PRESCALER 0 /< Value of the RTC1 PRESCALER register. */ #define APP_TIMER_MAX_TIMERS 2 /< Maximum number of simultaneously created timers. */ #define APP_TIMER_OP_QUEUE_SIZE 4 /**< Size of timer operation queues. */

    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);

    }

Children
No Data
Related