But the finished project has a meanwell 240v to 12v as i have 12v stepper motors then 12v to 5v that powers all arduino, rtc, sd card, a4988 stepper drivers. But as soon as i reconect the project to mains it loses the time.
I cant work out why its started to lose the time, tried a different LIR battery and rtc module
I have read that maybe the RTC needs a 3.3v circuit, but tbh when powered by usb it will be getting 5v
so to sum up
usb off / usb on time ok
usb off / mains on time reset
mains off / usb on time ok
mains off / mains on time reset
battery is in, as when when u disconnect power from either source, it retains time when powered by usb after, but connecting mains then loses the time to the default one
as i said it remembers the time when power off via usb / mains, but only when power is restored on mains it loses the time, default time is 00.00.00 01-01-2000