How to set and read the RTC?
Install the Portenta Breakoutboard library through the library manager, and the examples to get and set will be there
Thank you, I have found it.
Strange.
About a month ago, I had set the clock right.
The clock is buffered with a battery. Neither month day or hour are still correct.
If it had stopped it would show something completely different.
The examples show how to read or set the clock. But to regulate the tempo they are not suitable.
Today is April 24, 2022 In the example a month is already added to utcTime.month
As far as I understood the documentation correctly, the insertable battery in the Portenta Breakout Board is used to buffer the clock. So that if no additional power supply is available, the clock still continues to run.
From the attached pictures you can see that this is unfortunately not the case. I would find it very inconvenient if you had to set any extra registers to get this functionality.
Does anyone know more about this behavior?
Do I have to solder a bridge on the board?
/*
Portenta Breakout - BreakoutRTCGet
The sketch shows how to read the RTC of the Portenta H7 using the Portenta Breakout.
The circuit:
- Portenta H7
- Portenta Breakout
- CR2032 Battery
This example code is in the public domain.
*/
#include <Arduino_PortentaBreakout.h>
Timestamp utcTime;
void setup() {
Serial.begin(9600);
while (!Serial);
}
void loop() {
// Read the current timestamp from the RTC
utcTime = Breakout.RTClock.getTime();
// Print the data
Serial.println(utcTime.getUnixTimestamp());
Serial.print("year: ");
Serial.println(utcTime.year() + 1900);
Serial.print("month: ");
Serial.println(utcTime.month() + 1);
Serial.print("day: ");
Serial.println(utcTime.day());
Serial.print("hours: ");
Serial.println(utcTime.hour());
Serial.print("minutes: ");
Serial.println(utcTime.minute());
Serial.print("seconds: ");
Serial.println(utcTime.second());
delay(1000);
}
I may have found a clue to solving the problem of why the battery is not keeping the clock alive.
STM32 RTC Problem on Stack Overflow
As far as I understand the answers in this thread it is about the reset mode used.
Unfortunately, I am not at all familiar with the code shown there. Could someone here maybe help me to implement this solution for the Arduino Portenta?
I got confirmation from arduino tech support, that rtc hardware on portenta h7 is broken, and cannot be fixed by software.
They are creating a new revision for the board that will fix this problem, but no info as to when that will be yet.
Thank you for this information.
Apparently the initial version of the board were wired wrong, but the current ones are OK.
However the firmware is configured to take the clock input from the internal oscillator.
Trying to find out from tech support how to switch the input, without having to recompile the entire mbed OS.
Do you think it would be possible to re-solder the board yourself.
I am not sure which version i have, they are not very forthcoming with info such as this (likely because there are layers between the tech support and the actual design engineers).
The Xtal is a small 4 pin BGA, I think it would likely be difficult, and I may already have the correct board - just not enabled.
On the last communication, I was given some mbed subroutine calls that are supposd to turn the lse vs lsi on, but they did not compile (as the subroutines have no linker targets).
A a worry on my end, he also said that the mbed system checks if an external clock is present, and enables the internal one if not.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.