Report
5 months, 1 week ago.

LPC1768 RTC not starting.

I updated Mbed2 library files to the latest version 170: (Nov 2018) and the RTC does not start counting, using time functions it remains at zero. If I replace the Mbed2 library files back to version 111: ( Jan 2016) it works normally again.

Question relating to:

Rapid Prototyping for general microcontroller applications, Ethernet, USB and 32-bit ARM® Cortex™-M3 based designs
Comment on this question

1 Answer

3 months ago.

Hello, Paul

The RTC seems to work fine on my mbed LPC1768 board with the latest Mbed OS2. I tested the program below using the online compiler:

#include "mbed.h"

DigitalOut led1(LED1);

// main() runs in its own thread in the OS
int main() {
    
    while (true) {
        led1 = !led1;
        time_t t = time(NULL);   
        printf("Time as a basic string = %s\r\n", ctime(&t));
        wait(1);
    }
}

Okay, let me have another go.

Yes it is working with Mbed official libraries, I've been using the DEV libraries. Let me double check (takes forever to load these).

Well surprise surprise, loaded DEV rev 187 and no go, all you get is:

Time as a basic string = Sun Jan 1 00:00:00 1900

Happy days :)

Makes you wonder who changes the MBED libraries, whilst I love MBED I think sometimes chimpanzees do look a viable option :) Only joking!!!!

Perhaps I should stick with the Official releases, but my problem is I have to change some of the clock settings, that I can not do unless I have the DEV files.

Edit......

The problem was in the targets.json file, Target LPC1768: "device_has": was missing "RTC". put that in and its now working.

posted by Paul Staron 19 Jan 2019

To post an answer, please log in.