~Datasheet - RTC, WATCHDAG

====6410的RTC====

The Real-Time Clock (RTC) unit can be operated by the backup battery when the system power is

off. The data include the time by second, minute, hour, date, day, month, and year.

The RTC unit works with an external 32.768 KHz crystal and can perform the alarm function.

 

 

====2000年问题====

LEAP YEAR GENERATOR

The leap year generator can determine the last date of each month out of 28, 29, 30, or 31,

based on data from BCDDAY, BCDMON, and BCDYEAR.

缺陷:

This block considers leap year in deciding on the last date. An 8-bit counter

can only represent 2 BCD digits, therefore it cannot decide whether “00” year (the year with its last two

digits zeros) is a leap year or not. For example, it cannot discriminate between 1900 and 2000.

解决:

To solve this problem, the RTC block in S3C6410 has hard-wired logic to support the leap yearin

2000. Note 1900 is not leap year while 2000 is leap year. Therefore, two digits of 00 in S3C6410

denote 2000, not 1900.

So, RTC in S3C6410 supports from 1901 to 2099.

SOC上若是集成了RTC,一般menuconfig选上后上电即刻。使用系统函数API即刻获得墙上时间。

 

 

====6410的看门狗====

一幅经典的一目了然的图,四个寄存器与上图对号入座。

 

controller setting:

wdt->WTCON = (50 << 8) | (1 << 5) | 1;
wdt->WTDAT = 0x8000; //初始值
wdt->WTCNT = 0x8000;
/***************************************************/
pwm->TCFG0 = 49 << 8;
pwm->TCFG1 = 3 << 16;
pwm->TCNTB4 = 0x8000;
request_irq(INT_TIMER4, pwm_start);
pwm->TCON = 5 << 20;

 

补充==>

脉冲宽度调制(PWM)是一种对模拟信号电平进行数字编码的方法。通过高分辨率计数器的使用,方波的占空比被调制用来对一个具体模拟信号的电平进行编码。

PWM信号仍然是数字的,因为在给定的任何时刻,满幅值的直流供电要么完全有(ON),要么完全无(OFF)。

电压或电流源是以一种通(ON)或断(OFF)的重复脉冲序列被加到模拟负载上去的。

通的时候即是直流供电被加到负载上的时候,断的时候即是供电被断开的时候。只要带宽足够,任何模拟值都可以使用PWM进行编码。

  

http://hi.baidu.com/kebey2004/item/9a38fc369e7585f7a98428fe

posted @ 2012-11-22 13:13  郝壹贰叁  阅读(383)  评论(0编辑  收藏  举报