Hi everyone, does anyone have a code for Flowcode that I can use to enable the alarm Int output while the DS3231 is on battery backup. At this time my code works fine on power. This would help me to wake the MCU circuits with a power up circuit that I would design. I would be able to shut the main voltage/power to the entire circuit I am building and conserve the battery life. I have everything else working, I just need help with the DS3231 SQW alarm/Int output while on battery backup.
Thank you,
Pierre
DS3231 Alarm Int Output When On Battery Backup
-
Matrixv8
- Posts: 20
- http://meble-kuchenne.info.pl
- Joined: Mon Jun 03, 2024 2:51 am
- Been thanked: 4 times
-
chipfryer27
- Valued Contributor
- Posts: 1883
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 410 times
- Been thanked: 633 times
Re: DS3231 Alarm Int Output When On Battery Backup
Hi
Not sure I understand correctly.
Are you having the uC "sleep" and the DS3231 is to wake it up at a set time? If so a C-code block would do that with the DS3231 Int pin connected to any IOC / Interrupt pin on the uC.
Or is your entire circuit "shutdown" including uC and you will repower at a set time?
From the datasheet
A logic-level FET would do that and they range in currents from mA to many Amps. You would need to "self hold" once triggered, possibly by using a pin on the uC to keep the FET triggered.
Perhaps I have misunderstood?
Regards
Not sure I understand correctly.
Are you having the uC "sleep" and the DS3231 is to wake it up at a set time? If so a C-code block would do that with the DS3231 Int pin connected to any IOC / Interrupt pin on the uC.
Or is your entire circuit "shutdown" including uC and you will repower at a set time?
From the datasheet
A logic-level FET would do that and they range in currents from mA to many Amps. You would need to "self hold" once triggered, possibly by using a pin on the uC to keep the FET triggered.
Perhaps I have misunderstood?
Regards
Re: DS3231 Alarm Int Output When On Battery Backup
Thank you chipfryer27 for your reply, I am sorry if I was not clear. All I need is to enable the SQW output that matches the alarm when the module goes to battery backup, the battery on the module. I have set the module to go low at every minute with Flowcde already when on power. So all I need, like you said, would be a C-code block to enable the bit(s) in the registers to do just that. I am not very good a C code. I have an electronic background so the rest is easy.
Thank you for your interest,
Pierre
Thank you for your interest,
Pierre
-
chipfryer27
- Valued Contributor
- Posts: 1883
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 410 times
- Been thanked: 633 times
Re: DS3231 Alarm Int Output When On Battery Backup
Haha
I just looked at the time I sent my reply.... I'm claiming to be half-asleep....
To access that register you just need to send a command to the register using I2C from your microcontroller. Best to set the entire register to what you require all at once. Address is in hex 0E, and it is bit 2 (3rd bit) that needs to be set.
Regards
I just looked at the time I sent my reply.... I'm claiming to be half-asleep....
To access that register you just need to send a command to the register using I2C from your microcontroller. Best to set the entire register to what you require all at once. Address is in hex 0E, and it is bit 2 (3rd bit) that needs to be set.
Regards