cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Year?

Dick Lin
Senior
Posted on June 23, 2018 at 02:06

Hi,

Why the RTC Year is a uint8_t and value must be b/w 0 and 99? How do we map to real year? Thx

/**

* @brief RTC Date structure definition

*/

typedef struct

{

uint8_t WeekDay; /*!< Specifies the RTC Date WeekDay.

This parameter can be a value of @ref RTC_WeekDay_Definitions */

uint8_t Month; /*!< Specifies the RTC Date Month (in BCD format).

This parameter can be a value of @ref RTC_Month_Date_Definitions */

uint8_t Date; /*!< Specifies the RTC Date.

This parameter must be a number between Min_Data = 1 and Max_Data = 31 */

uint8_t Year; /*!< Specifies the RTC Date Year.

This parameter must be a number between Min_Data = 0 and Max_Data = 99 */

}RTC_DateTypeDef;

Note: this post was migrated and contained many threaded conversations, some content may be missing.
13 REPLIES 13
Posted on June 25, 2018 at 19:39

You're probably using the wrong format (BCD vs Binary), if you're reading 0x43 it is 43 minutes in BCD

BCD uses two 4-bit pairs, ie ticks from 0x09 to 0x10

You should review how you're reading the values, and the settings involved.

You're providing observation where I can't see the context.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on June 25, 2018 at 19:44

Doesn't make any sense to have seconds exceed 59 either.

Name : Seconds

Details:84 'T'

Default:84 'T'

Decimal:84

Hex:0x54

Binary:1010100

Octal:0124

Posted on June 26, 2018 at 06:51

Mine

https://www.embedded.fm/blog/2018/6/5/an-introduction-to-bcd

 

A

Posted on June 26, 2018 at 07:32

Thanks. This help.

On Mon, Jun 25, 2018, 9:53 PM Andrei Chichak <st-microelectronics@jiveon.com>