8 years, 11 months ago.

Damn SPAMMERS! Can anything be done? (and LPC1768 RTC stops)

Arrrrr..... this forum has been hit by spammers, obviously. I find this REAL annoying, as I'm hoping to get some questions answered here, regarding a few technical issues that I'm having. And I somehow doubt if a 'black magic specialist' could help (or perhaps he could - I sometimes think!). Can anything be done about this? We've all got work to do, and this isn't helping. John (PS My technical problem right now is that on the LPC1768 module the Real Time Clock (RTC) stops when the main power is removed, despite having a 3.3V backup battery connected to the Vbat pin. The RTC resumes counting as normal after main power is restored.)

Is the LPC1768 version of the MBED capable of maintaining the clock? Looking at the diagram the Vbat line maintains something, I'm going to look it up next but presumably it maintains RAM? but without the main crystal is there any oscillator to keep the RTC ticking?

Oops FOUND IT!!

Crystal X2 in the lower left corner of the third page.

posted by Oliver Broad 10 Mar 2016

2 Answers

8 years, 11 months ago.

Someone else asked this question a few days ago, his older LPC worked but a newer one didn't, Can you check the VBATERY voltage directly on the MCU itself, not just on the header pin. Check page 2 of the circuit, there are diodes in this circuit, perhaps they have not been fitted.

Edit......

I have just tried the latest MBED library and have the same problem, so it looks like the library has been broken recently.

Accepted Answer

I did have a quick look in the reference manual, but didn't see anything about disabling the RTC oscillator. And that is what happens apparantly, since the time is still stored, so the power to the RTC is fine.

posted by Erik - 24 May 2015

Not too sure if there is a problem, my back up cell had dropped to 1.5v, checking a bit further...

Checked on another board and that is keeping time on the back up cell, so must be a problem with his LPC1768.

This guy was having issues, but I think his problem is because the RTC has not been set it does not start counting.

https://developer.mbed.org/questions/52493/Problem-with-RTC-initialization/#answer7609

posted by Paul Staron 24 May 2015

Maybe there is a way to disable the RTC device , look at the library "mbed PowerControl Library" from Michael Wei: "define LPC1768_PCONP_PCRTC "

posted by Robert Spilleboudt 24 May 2015

There was an issue with some older mbed LPC1768's taking excessive current from the backup battery. Take a look at this post: https://developer.mbed.org/users/chris/notebook/rtc-battery-backup-current

posted by Paul Griffith 25 May 2015

SOLVED! Following the suggestion here from Paul Staron, I ordered a needle-point DVM probe, which just arrived. I measured the Vbat voltage on the actual chip pin (pin19), and it read 0V, while the VBat voltage on the module connector pin was reading 3.3V. So, there seems to be a connection problem on the module (or one of those diodes is missing). Time to get another one (and ask questions about the assembly of these things). Thanks for the help, Paul.

posted by John OSullivan 29 May 2015
8 years, 11 months ago.

With a 1768 I use the RTC , with a backup alimentation for VBat and the RTC time remains correct when the main power is shut. Can you check the real voltage at Vbat without the main power supply?

I use the c++ time

     //using ctime.h http://www.cplusplus.com/reference/ctime/
        struct tm t;
        t.tm_year = atoi(tokens[0].c_str()) - 1900;
        t.tm_mon= atoi(tokens[1].c_str()) - 1;
        t.tm_mday= atoi(tokens[2].c_str());
        t.tm_hour = atoi(tokens[3].c_str());
        t.tm_min = atoi(tokens[4].c_str());
        t.tm_sec = atoi(tokens[5].c_str());
        set_time(mktime(&t));

A remark: if you do NOT initialize RTC clock, the initial value after power-on is random!!!

Hi Robert, thanks for the response. Yes, I had already checked the Vbat voltage at the Vb pin on the LPC1768 board with the main power supply (from USB) disconnected. It reads 3.3V. So that is not the problem. Can you post the code that you use for the RTC? Perhaps I need to enable something.

posted by John OSullivan 24 May 2015