About CY8CKIT-042-BLE-A bluetooth low energy pioneer kit?--About Code ?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Robin_Peng
Level 5
Level 5
Distributor - Macnica(GC)
100 replies posted 50 replies posted 50 questions asked

Hi Sir.

I have some basic questions,The development kit I use is CY8CKIT-042-BLE-A. The chip I use is CY8C4247LQI-BL463.

RTC I want to implement a timer alarm function, such as pressing a key to start timing, automatic alarm after two hours, I want to know if there is a function of the interval that can be called directly?

Thanks

0 Likes
1 Solution
LiDo_2439176
Level 5
Level 5
First question asked 50 replies posted 50 sign-ins

Hi RoPe_2386886​,

you can start by creating a new project with RTC_P4_WDT_Example.

Add a key. When you press the key reads the current time and date. Add 2h then set alarm.

More about RTC on component datasheet.

It seems there is no function of the interval that can be called directly.

Best regards,

Liviu

View solution in original post

5 Replies
LiDo_2439176
Level 5
Level 5
First question asked 50 replies posted 50 sign-ins

Hi RoPe_2386886​,

you can start by creating a new project with RTC_P4_WDT_Example.

Add a key. When you press the key reads the current time and date. Add 2h then set alarm.

More about RTC on component datasheet.

It seems there is no function of the interval that can be called directly.

Best regards,

Liviu

Robin_Peng
Level 5
Level 5
Distributor - Macnica(GC)
100 replies posted 50 replies posted 50 questions asked

Hi Liviu,

I start by creating a new project with RTC_P4_WDT_Example.

(1)I modified the alarm time.After my test, there was no alarm, the TIME_HOUR jumped directly to 4 hours, and did not stay at 3 hours.Is there the problem with the setting?

pastedImage_1.png

(2)Is there a relationship between wake up and RTC?

pastedImage_3.png

pastedImage_4.png

Thanks

0 Likes

Hi RoPe_2386886​,

(1) So it is. In the main.c file the initial time and date is 02:59:50 from 03/22/2014.
As you can see in the Configure dialog

conf_RTC.png
the daylight savings time functionality is enabled at 3 o'clock on 03/22/2014.
So 3 o'clock becomes 4 o'clock.

(2) In this example yes. The WDT is the input clock source for RTC and at the same time sleep wakeup source to save time and power.

Best regards,

Liviu

Robin_Peng
Level 5
Level 5
Distributor - Macnica(GC)
100 replies posted 50 replies posted 50 questions asked

Hi Liviu,

As you said,there is a relationship between wake up and RTC.The WDT is the input clock source for RTC and at the same time sleep wakeup source to save time and power.

Let me briefly talk to you about my function of RTC: there is a button to start timing after pressing, and alarm after two hours, but even if the timer button is pressed, if the instrument does not work, it will sleep .

(1)The problem now is that when the alarm occurs 2 hours later, the alarmFlag is not cleared to 0    Whether working or sleeping  https://community.cypress.com/thread/54100

pastedImage_0.png

(2)I used two interrupts, one to wake up from sleep, and the other to RTC. Is there any problem with the usage of these 2 interrupts, causing alarmFlag to not be cleared?

(3)Now sleep wake is placed in the system file, is there any problem with this usage?

Thanks

0 Likes

Hi RoPe_2386886​,

(1) in this this example alarmFlag is more like a "snooze alarm". Clearing alarmFlag does not clear alarm. Why do we have repeated alarms ? Because of RTC_SetAlarmMask((uint32)~RTC_ALARM_SEC_MASK) function we'll have the alarm every second until the minute changes. Comment this line and there will be no more repeated alarms.

(2) There is no problem with the usage of these 2 interrupts. The RTC_SetAlarmMask((uint32)~RTC_ALARM_SEC_MASK); line is the cause. See (1).

(3) There is no problem with this usage.

Best regards,

Liviu