FAQ_How to add low power mode in the 2.4G private protocol Remote Control application scenario of BlueNRG-12
[Copy link]
Author: Weisheng CHEN, ST engineer
Click to download the pdf document:
FQA-如何在BlueNRG-12的2.4G私有协议Remote Control 应用场景中添加低功耗模式及按键.pdf
(460.5 KB, downloads: 9)
Keywords: BlueNRG-1/2, 2.4G private protocol, low power consumption
Question: How to use the 2.4G private protocol technology of BlueNRG-1/2 to implement low power mode and local button wake-up and send data packets in Remote Control applications.
Background: The customer uses the BlueNRG-1/2 chip to design its 2.4G private protocol product. The application scenario refers to the Remote Control demo code in the SDK provided by ST. The TX end is battery-powered and needs to implement low-power mode. When the button is pressed, the command packet is sent in time. At the same time, the TX/RX part needs to exchange data within a specified time interval (such as 2 seconds). The RX end is powered for a long time and does not require low-power mode.
ST engineer's answer: The customer's requirements are concentrated on the TX end. Customers can refer to the SLEEP_TX/RX demonstration code in the SDK provided by ST. The demonstration code itself has implemented the low-power mode, and gives the timing information for the next wake-up when calling the function HAL_RADIO_SendPacketWithAck in the main loop. So we only need to add the function of waking up the system and sending data packets by pressing the local button. According to the hardware resources of the ST 008V2 evaluation board, we can use the PUSH1 button (GPIO13) as the wake-up source, and wake up the system and send data packets when PUSH1 is pressed. The software part can make the following changes in the main loop:
#if 1
BlueNRG_Sleep(SLEEPMODE_WAKETIMER, WAKEUP_IO13, WAKEUP_IOx_LOW << WAKEUP_IO13_SHIFT_MASK);
if ((GPIO_GetITPendingBit(GPIO_Pin_13) == SET) || ((wakeupFromSleepFlag) && (BlueNRG_WakeupSource() == WAKEUP_IO13)))
{
GPIO_ClearITPendingBit(GPIO_Pin_13);
ret = HAL_RADIO_SendPacketWithAck(FREQUENCY_CHANNEL,TX_WAKEUP_TIME1, sendData, receivedData, RX_TIMEOUT_ACK, TxCallback);
if(ret != SUCCESS_0) {
printf("WAKEUP ERROR %d (%d)\r\n",ret, packet_counter);
}
sleep_timer();
}
#else
BlueNRG_Sleep(SLEEPMODE_WAKETIMER, 0, 0);
#endif
|