RTC Introduction RTC (Real-time clock) abbreviation real-time clock, the main function is to remember when, produce alarm clock and so on. RTC has a backup battery, so even if the computer shuts down, it will not affect the RTC memory. The difference between
register
Tar: Time Register
2.5 time and calendar alarms
? Car: Calendar alarm register
Year shield/month shield/day shield/week Shield
? Tar: Time Alarm register
Time Blocking/minute blocking/second Blocking
2.6 24-hour/12-hour Mode Selection
Bit0 of the tssr register:
U 1: 24-hour Mode
Ü 0: 12-hour Mode
2.7 weeks and leap years
? RTC supports the
Document directory
RTC interrupt service program
Reprint address (this article is also reproduced): http://blog.chinaunix.net/uid-15443744-id-2772596.html
Each pc has a Real-Time Clock device. When you turn off the computer power, it maintains the system's date and time information.
In addition, it can also be used to generate periodic signals with a frequency change ranging from 2Hz to 8192Hz -- of course, the frequency must be a multiple of 2
My external RTC is DS1339, driven by rtc-ds1307.cI chose it in the kernel.And[*] Set system time from RTC on startup and resume││││ (RTC0) RTC used to set the system time││││[*] RTC Debug support││││*** RTC Interfaces ***││││[*]/S
, LCD controller, 4-channel DMA, 3-channel UART, IIC bus,IIS Bus, SD host interface, PWM timer, watchdog, on-chip PLL clock generator, 8-Channel 10-bit ad controller, touch screen interface, and real-time clock with Calendar function, which greatly facilitates the systemIntegrated development.
2.2 hardware architecture of the s3c244o processor rtcThe structure of the Internal RTC module of S3C2440 is shown in Figure 1. The
Instructor song,Hua Qing vision embedded college lecturer.
1.1 Introduction to rtc
In an embedded system, RTC is usually used to provide reliable system time, including hour, minute, second, and year, month, and day, it is also required that the system work properly when it is shut down (usually powered by a backup battery ). Its Peripheral does not require too much auxiliary electrical channels. Typically,
);// Call the READ function to wait the alarm interruptRet = read (FD, Data, sizeof (unsigned long ));...Close (FD );
**************************************** ************************3. RTC deivce IOCTL**************************************** ************************Rtc_swcnt_off: This IOCTL does not need an argument, and it canBe used to disable the RTC stop-w
processing interface abstracted by the user using sylixos, which is implemented by the user. It is a key parameter for the RTC device creation function api_rtcdevcreate. It contains four function pointers pointing to the RTC initialization function interface, setting the RTC time function interface, and obtaining the RTC
time directly in the wince interface. At this time, the system will call oemsetrealtime (..) write the time you set to the RTC module. We all know that there is a case in the oemiocontrol function named ioctl_hal_init_rtc. This case is used to set the initial value of the real-time clock during initialization, in this case, oemsetrealtime (...) is called (..) function. The reference code is as follows:
Case ioctl_hal_init_rtc:// The kernel has detect
RTC is a relatively common part of the current device, and many devices need to look at the time. RTC Real-time clock has been integrated in a number of microcontroller, before also dedicated clock chip, now the CORTEX-M3 core includes this part. Unlike previous NXP's ARM7 cores, the LPC1768 clock source is provided only by the 32K clock source, which is to be noted, and the other is consistent with ARM7.
module, which can be programmed to produce up to 1 seconds of RTC Time Reference TR_CLK. The RTC Prescaler module contains a 20-bit programmable divider (RTC Prescaler). If the appropriate allowable bit is set in the RTC_CR register, the RTC generates an interrupt (second interrupt) in each real-time clock (
= platform_get_irq (pdev, 1 );
If (s3c2410_rtc_tickno
Dev_err ( pdev-> Dev, "No IRQ for RTC tick/N ");
Return-enoent;
}
/*
* Get the RTC interrupt resource of the device. View platform_get_irq. We can see that we actually get it by searching pdev resources. * The pdev resources are specified when building the platform_device object, to Devs. view in C
*/
S3c2410_rtc_alarmno = platform_get_irq (pdev, 0 );
The RTC of F4. The RTC of the F1 series is a simple counter. To obtain the time, you have to calculate it by yourself. F4.
[Main features]
The RTC of ipvf4 is an independent BCD/clock Counter. RTC provides a time calendar and two-way alarm clock interrupt, a periodic pro
For details about RTC programming in the Linux operating system kernel, refer to general Linux technology-Linux programming and kernel information. Programming RTC in Linux Kernel
The MC146818 RTC chip (or other compatible chip, such as DS12887) can generate periodic interruptions on IRQ8, with the Interruption Frequency ranging from 2Hz ~ Between 8192HZ. The
Res, array_size (res), NULL, 0); 33}Finally call Imx_add_platform_device to register the RTC in.So what is the code like on the driver side? The main parts of the analysis are:1/*! 2 * The RTC driver structure 3 */4 static struct Rtc_class_ops Snvs_rtc_ops = {5 . open = Snvs_rtc_open, 6
.release = snvs_rtc_release, 7 . Read_time = Snvs_rtc_read_time, 8 . set_time = snvs_rtc_set_time, 9
STM32 's real-time clock is a standalone timer
Typically, a coin cell is added to the supply side of the backup area, and the RTC does not stop working when the mains power is not powered
RTC can trigger a second interrupt, overflow interrupt, and alarm interrupt if the VDD power supply is active
Backup Register BKPThe backup registers are 42 16-bit registers, th
In an embedded system, real-time clock units can provide reliable clocks, including hour, minute, second, and year, month, and day. Even if the system is shut down, it can work normally (usually powered by a backup battery), and its peripheral does not require too many auxiliary circuits, typically, you only need a high-precision crystal oscillator.
S3C2410 rtcFeatures:
1. Clock data adopts BCD Encoding
2. Automatic Processing of the year, month, and day of a leap year
3. An
DescriptionThis paper analyzes code based on 3.10 kernel, hardware platform for embedded arm platform.
2. RTC Subsystem Related filesdrivers/rtc/class.cdrivers/rtc/interface.cdrivers/rtc/rtc-core.hdrivers/rtc/
The real-time clock (RTC) unit can work with a backup battery when the system power is off. RTC can be operated by using STRB/LDRB ARMSends 8-bit binary Exchange Code (BCD) value data to the CPU. The data includes the time information of the year, month, day, week, hour, minute, and second.The RTC unit operates on an external 32.768kHz crystal oscillator and can
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.