MCUXpresso_MKS22FN256xxx12/boards/mapsks22/demo_apps/rtc_func
2022-06-18 14:53:46 +08:00
..
armgcc Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
board.c Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
board.h Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
clock_config.c Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
clock_config.h Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
pin_mux.c Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
pin_mux.h Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
readme.txt Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
rtc_func.bin Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
rtc_func.c Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00
rtc_func.xml Initial SDK 2.4.1 2022-06-18 14:53:46 +08:00

Overview
========
The RTC demo application demonstrates the important features of the RTC Module by using the RTC Peripheral Driver.

The RTC demo supports the following features:

- Calendar
  + Get the current date time with Year, Month, Day, Hour, Minute, and Second.
  + Set the current date time with Year, Month, Day, Hour, Minute, and Second.

- Alarm
  + Set the alarm based on the current time.
  + Application prints a notification when the alarm expires.

- Seconds interrupt
  + Use second interrupt function to display a digital time blink every second.

Toolchain supported
===================
- Keil MDK 5.24a
- IAR embedded Workbench 8.22.2
- GCC ARM Embedded 7-2017-q4-major
- MCUXpresso10.2.0

Hardware requirements
=====================
- Mini/micro USB cable
- MAPS-KS22F256 board & MAPS-DOCK board
- Personal Computer

Board settings
==============
The rtc_func demo is configured to use UART1 with PTE0 and PTE1 pins. To make JLink serial
device work, the jumpers on MAPS-DOCK board should be set as following:
- JP7 on MAPS-Dock: UART0 related jumpers connected

Prepare the Demo
================
1.  Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
2.  Open a serial terminal with the following settings:
    - 115200 baud rate
    - 8 data bits
    - No parity
    - One stop bit
    - No flow control
3.  Download the program to the target board.
4.  Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo
================
The following menu is displayed in the serial terminal:

~~~~~~~~~~~~~~~~~~~~~
RTC Demo running...

Please choose the sub demo to run:

1) Get current date time.

2) Set current date time.

3) Alarm trigger show.

4) Second interrupt show (demo for 20s).

Select:
~~~~~~~~~~~~~~~~~~~~~

### 1. Get current date time: {#GetTime}

This command gets the current date time in the format of YYYY-MM-DD HH:MM:SS.
~~~~~~~~~~~~~~~~~~~~~
Current datetime: 2015-11-11 11:11:11
~~~~~~~~~~~~~~~~~~~~~

### 2. Set current date time {#GetDate}

Sets the date time as YYYY-MM-DD HH:MM:SS.
~~~~~~~~~~~~~~~~~~~~~
Input date time like: "2010-10-10 10:10:10"
2009-10-10 10:10:10
~~~~~~~~~~~~~~~~~~~~~

### 3. Show the alarm function {#ShowAlarm}

Sets the alarm time: 1~9 seconds from the time you input and waits for the alarm event arrival.
~~~~~~~~~~~~~~~~~~~~~
Input the alarm seconds from the current moment (1s~9s):3
Triggered Alarm: 10:10:31
~~~~~~~~~~~~~~~~~~~~~

### 4. Seconds interrupt show {#Seconds}

Shows the digital time animation by seconds-interrupt function.
~~~~~~~~~~~~~~~~~~~~~
10:10:51
10:10:51
...
10:11:11
~~~~~~~~~~~~~~~~~~~~~
Customization options
=====================