Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 4 months ago.
Where is the documentation?
This page is seriously under-documented. It doesn't answer any of these questions:
1. How is this implemented? Does it use a hardware RTC or the microsecond ticker?
2. Does it use the hardware RTC but fall back to the microsecond ticker if it's not present?
3. Which boards have a hardware RTC?
4. Which boards have backup batteries for the RTC? I.e. is the time preserved across boots?
5. What if I just want the number of milliseconds since boot? (i.e. I don't care about the date)
I looked at the code myself and found the following answers:
1. It uses the RTC. clock() uses the microsecond ticker.
2. No, if there is no on-board RTC it just returns 0. However you can add an external RTC using the attach_rtc() function.
3. See below.
4. No idea.
5. Use the clock() function. It returns the number of microseconds since boot in an unsigned long (64 bit).
List of boards with RTC, as of 2/7/2015: (search for "#define DEVICE_RTC 1").
TARGET_Freescale\TARGET_K20XX\TARGET_K20D50M TARGET_Freescale\TARGET_K20XX\TARGET_TEENSY3_1 TARGET_Freescale\TARGET_KLXX\TARGET_KL05Z TARGET_Freescale\TARGET_KLXX\TARGET_KL25Z TARGET_Freescale\TARGET_KLXX\TARGET_KL43Z TARGET_Freescale\TARGET_KLXX\TARGET_KL46Z TARGET_Freescale\TARGET_KPSDK_MCUS\TARGET_K22F TARGET_Freescale\TARGET_KPSDK_MCUS\TARGET_MCU_K64F\TARGET_FRDM TARGET_Freescale\TARGET_KPSDK_MCUS\TARGET_MCU_K64F\TARGET_MTS_GAMBIT TARGET_NXP\TARGET_LPC11U6X TARGET_NXP\TARGET_LPC15XX TARGET_NXP\TARGET_LPC176X\TARGET_ARCH_PRO TARGET_NXP\TARGET_LPC176X\TARGET_MBED_LPC1768 TARGET_NXP\TARGET_LPC176X\TARGET_UBLOX_C027 TARGET_NXP\TARGET_LPC23XX TARGET_NXP\TARGET_LPC408X TARGET_NXP\TARGET_LPC43XX\TARGET_LPC4330 TARGET_NXP\TARGET_LPC43XX\TARGET_LPC4337 TARGET_RENESAS\TARGET_RZ_A1H TARGET_STM\TARGET_DISCO_F100RB TARGET_STM\TARGET_DISCO_F303VC TARGET_STM\TARGET_DISCO_F334C8 TARGET_STM\TARGET_NUCLEO_F103RB TARGET_STM\TARGET_NUCLEO_F302R8 TARGET_STM\TARGET_NUCLEO_F303RE TARGET_STM\TARGET_NUCLEO_F334R8 TARGET_STM\TARGET_STM32F0\TARGET_DISCO_F051R8 TARGET_STM\TARGET_STM32F0\TARGET_NUCLEO_F030R8 TARGET_STM\TARGET_STM32F0\TARGET_NUCLEO_F070RB TARGET_STM\TARGET_STM32F0\TARGET_NUCLEO_F072RB TARGET_STM\TARGET_STM32F0\TARGET_NUCLEO_F091RC TARGET_STM\TARGET_STM32F3XX TARGET_STM\TARGET_STM32F4\TARGET_ARCH_MAX TARGET_STM\TARGET_STM32F4\TARGET_DISCO_F401VC TARGET_STM\TARGET_STM32F4\TARGET_DISCO_F407VG TARGET_STM\TARGET_STM32F4\TARGET_DISCO_F429ZI TARGET_STM\TARGET_STM32F4\TARGET_MTS_DRAGONFLY_F411RE TARGET_STM\TARGET_STM32F4\TARGET_MTS_MDOT_F405RG TARGET_STM\TARGET_STM32F4\TARGET_MTS_MDOT_F411RE TARGET_STM\TARGET_STM32F4\TARGET_NUCLEO_F401RE TARGET_STM\TARGET_STM32F4\TARGET_NUCLEO_F411RE TARGET_STM\TARGET_STM32L0\TARGET_DISCO_L053C8 TARGET_STM\TARGET_STM32L0\TARGET_NUCLEO_L053R8 TARGET_STM\TARGET_STM32L0\TARGET_NUCLEO_L073RZ TARGET_STM\TARGET_STM32L1\TARGET_NUCLEO_L152RE
Question relating to:
2 Answers
9 years, 1 month ago.
Concerning Number 4. The mBed platforms are open- source, so you should look at the schematic of the particular platform you are using. Most platforms like mBed, Arduino, etc aren't going to have a battery pre- installed. Just hook up a coin cell battery to preserve the memory while the mBed is off if you are building a RTC application.
Also if you need to know what hardware your ARM chip includes look at its Datasheet, i.e. the mbed LPC 1768 is based on the LPC1768, a quick google search will pull up the datasheet for the ARM LPC1768 which will outline all the hardware peripherals.
Each of the mBed platforms has an overview page including schematics, datasheets, and must things you need. Click on "Platforms" and select your device...
https://developer.mbed.org/platforms/
Cheers
8 years, 12 months ago.
I have found a documentation of a earlier version here: https://developer.mbed.org/handbook/Time?action=view&revision=11592