Shop OBEX P1 Docs P2 Docs Learn Events
BCD for DS1307 — Parallax Forums

BCD for DS1307

ArchiverArchiver Posts: 46,084
edited 2002-05-02 15:07 in General Discussion
Can someone explain BCD for me. I am trying to write some code to set the
functions of the clock but I am confused on how to display or work with my
numbers. Do I use hex or decimal? It seems that when I set the register to
what I want then go to display it I get a 2a or something like that.


[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-05-01 23:41
    >Can someone explain BCD for me. I am trying to write some code to set the
    functions of the clock but I am confused on how to display or work with my
    numbers. Do I use hex or decimal? It seems that when I set the register to
    what I want then go to display it I get a 2a or something like that.

    Binary Coded Decimal - BCD - is a hybrid number system. Each digit of the
    decimal number is
    represented by a binary number. For example, 176 in decimal would be 0001
    0111 0110 in BCD.
    This number system is used mainly where some binary data needs to be
    presented in decimal
    form, time displays being a prime example.

    Got it?

    Carl
  • ArchiverArchiver Posts: 46,084
    edited 2002-05-02 15:07
    Wow, its a nice chip, can you get these from jamaco, or who would you
    recomend? Though I like my DS1387 slightly better, as the clock and battery
    is all built in.

    Original Message
    From: "Ricky Konvicka" <ricky@m...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, May 01, 2002 10:33 AM
    Subject: [noparse][[/noparse]basicstamps] BCD for DS1307


    >
    > Can someone explain BCD for me. I am trying to write some code to set the
    functions of the clock but I am confused on how to display or work with my
    numbers. Do I use hex or decimal? It seems that when I set the register to
    what I want then go to display it I get a 2a or something like that.
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
Sign In or Register to comment.