Hello to everyone. I write code for NRF24LE1 using KEIL and rtx tiny. But i have some problems.
When i power on my device, programm don't run correctly, but when hard reset everythink works good.
right down is my init task "first task of my programm" thanks.
void init (void) _task_ INIT { // Wait for XOSC to start to ensure proper UART baudrate while(hal_clk_get_16m_source() != HAL_CLK_XOSC16M) {} os_wait (K_TMO, 100, 0); /* wait for timeout: 100 ticks ~ 1sec */ os_wait (K_TMO, 100, 0); /* wait for timeout: 100 ticks ~ 1sec */ os_wait (K_TMO, 100, 0); /* wait for timeout: 100 ticks ~ 1sec */ gpio_pin_dir_output(GPIO_PIN_ID_P1_1, GPIO_PIN_CONFIG_OPTION_PIN_MODE_OUTPUT_BUFFER_NORMAL_DRIVE_STRENGTH);//pin1_1 output for IGT os_create_task (SERIAL); os_create_task (GSM); os_delete_task (INIT); /* kill task init */ while (1) { } }
a small divergence if your uC does not have internal reset circuitry it is best is to have a dedicated supervisor chip. They will work both for short glitches in the supply power and when the power is away for a longer time. And they can reset the chip when the voltage is too low.