Shop OBEX P1 Docs P2 Docs Learn Events
Sort of a newbie...could use some help!? — Parallax Forums

Sort of a newbie...could use some help!?

ArchiverArchiver Posts: 46,084
edited 2003-10-07 20:51 in General Discussion
Ok guys...I'm working on a project that will interface with a PCF8583
RTC wRam. Here is my problem......I have no idea what I'm doing with
respect to I2C. I really need someone to break this down to basics
for me. I'm specifically looking for an alarm from the RCT every
1/10th of a second. But Like I said...I don't get the I2C protocol.


Any help would be appreciated.


James
Success is 1% inspiration and 99% perspiration. (Thomas Edison)

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 15:49
    At 02:24 PM 10/7/03 +0000, jelongus wrote:
    >Ok guys...I'm working on a project that will interface with a PCF8583
    >RTC wRam. Here is my problem......I have no idea what I'm doing with
    >respect to I2C. I really need someone to break this down to basics
    >for me. I'm specifically looking for an alarm from the RCT every
    >1/10th of a second. But Like I said...I don't get the I2C protocol.
    >
    >
    >Any help would be appreciated.
    >
    >
    >James
    >Success is 1% inspiration and 99% perspiration. (Thomas Edison)

    James -

    In order to answer your question it would help if we knew what kind of
    Stamp you're using, or planning to use.

    Bruce Bates




    >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/
  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 15:57
    Specifications for the I2C protocol are available on the Net from
    Philips. The short story is that it is a synchronous (separate data and
    clock lines), multi-drop buss. Devices on the buss are addressed by
    type and unit (many I2C devices support more than one of the same device
    type on the buss).

    The BS2p and BS2pe have built-in I2C commands, but you can bit-bang the
    signaling using SHIFTOUT and SHIFTIN with other BS2 micros. I've even
    heard that some people have written BS1 code for I2C. Now that I can
    program my BS1 from Windows (in testing -- you'll get it soon too!) I
    will give it a try.

    Take a look at our Nuts & Volts material -- you'll find Column #85 "I2C
    Fun for Everyone" useful. You'll find it in the Downloads section of
    our web site.

    If memory serves me, the PCF8583 has a 1 Hz output signal, so for your
    project you'll need to poll the 1/100th seconds register and work from
    there.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office



    Original Message
    From: jelongus [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=LH6OwIiP0F0ISmSJgYHYtTsdy5wJcycw8mPvN20xJtKmSnMAoKOkGlroWrtg0NuJsHg2bWyxQM_MXosGhYX-5pBTdEFq]propellanttech@c...[/url
    Sent: Tuesday, October 07, 2003 9:25 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Sort of a newbie...could use some help!?


    Ok guys...I'm working on a project that will interface with a PCF8583
    RTC wRam. Here is my problem......I have no idea what I'm doing with
    respect to I2C. I really need someone to break this down to basics
    for me. I'm specifically looking for an alarm from the RCT every
    1/10th of a second. But Like I said...I don't get the I2C protocol.


    Any help would be appreciated.


    James
    Success is 1% inspiration and 99% perspiration. (Thomas Edison)


    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/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 16:11
    Check http://www.robot-electronics.co.uk/htm/srf08stamp.shtml for sample I2C
    wiring and code. The example pertains specifically to the SRF08 ultrasonic
    sensor, but should work with the PCF8583 by substituting the appropriate
    device address and functions codes.

    -- Al Margolis, founder
    www.hobbyengineering.com
    The technology builder's source for kits, components, supplies, tools, books
    and education.

    Original Message
    From: jelongus [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=RG0FCkBo5_EYfuQgbDPeRQxX2zXlz6a52lhgSe0EmOK_pZks5B43iomXcpX1N09OOFkYt1Z2twcGg3CNvM9MGzeTkQ]propellanttech@c...[/url
    Sent: Tuesday, October 07, 2003 7:25 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Sort of a newbie...could use some help!?


    Ok guys...I'm working on a project that will interface with a PCF8583
    RTC wRam. Here is my problem......I have no idea what I'm doing with
    respect to I2C. I really need someone to break this down to basics
    for me. I'm specifically looking for an alarm from the RCT every
    1/10th of a second. But Like I said...I don't get the I2C protocol.


    Any help would be appreciated.


    James
    Success is 1% inspiration and 99% perspiration. (Thomas Edison)


    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/
  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 17:16
    Try Parallax's website, under Downloads, Nuts & Volts. Column 85,
    I2C for Everyone.

    It is a good article by the BS2 guru Mr. Jon Williams.

    It should be enough to get you started.

    Good luck.

    --- In basicstamps@yahoogroups.com, "jelongus" <propellanttech@c...>
    wrote:
    > Ok guys...I'm working on a project that will interface with a
    PCF8583
    > RTC wRam. Here is my problem......I have no idea what I'm doing
    with
    > respect to I2C. I really need someone to break this down to basics
    > for me. I'm specifically looking for an alarm from the RCT every
    > 1/10th of a second. But Like I said...I don't get the I2C protocol.
    >
    >
    > Any help would be appreciated.
    >
    >
    > James
    > Success is 1% inspiration and 99% perspiration. (Thomas Edison)
  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 18:28
    Bruce,

    I have a BS2P40

    I'm planning on using the I2C commands. Thanks for the help in
    advance.

    James


    >
    > James -
    >
    > In order to answer your question it would help if we knew what kind
    of
    > Stamp you're using, or planning to use.
    >
    > Bruce Bates
    >
    >
    >
    >
    > >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/
  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 18:37
    Jon,

    I have read all types of different material from Phillips, as well as
    Nuts and Volts, and the Stampworks articles as well.

    I just don't seem to get the whole picture about using I2C with the
    PCF 8583.

    I'm a litle lost about the command structure. I have read so many
    things ....now I'm confused. All I want is for the RTC to tell the
    Stamp when 1/10th of a second has passed, but every attempt I
    make...gives me strange results. I tried to get the RTC to display
    (with debug) 100th's of seconds.....but the number is just 000 to
    009. It also moves the second digit,but so fast you can hardly notice
    it.

    That is the reason I came here. You guys probably understand the
    communication layout much better than I. I'm really lost when it
    comes to I2C. Doesn't make a whole lot of sense.

    Thanks,

    James



    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > Specifications for the I2C protocol are available on the Net from
    > Philips. The short story is that it is a synchronous (separate
    data and
    > clock lines), multi-drop buss. Devices on the buss are addressed by
    > type and unit (many I2C devices support more than one of the same
    device
    > type on the buss).
    >
    > The BS2p and BS2pe have built-in I2C commands, but you can bit-bang
    the
    > signaling using SHIFTOUT and SHIFTIN with other BS2 micros. I've
    even
    > heard that some people have written BS1 code for I2C. Now that I
    can
    > program my BS1 from Windows (in testing -- you'll get it soon too!)
    I
    > will give it a try.
    >
    > Take a look at our Nuts & Volts material -- you'll find Column
    #85 "I2C
    > Fun for Everyone" useful. You'll find it in the Downloads section
    of
    > our web site.
    >
    > If memory serves me, the PCF8583 has a 1 Hz output signal, so for
    your
    > project you'll need to poll the 1/100th seconds register and work
    from
    > there.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 18:55
    If you can read the device (and there is code on our web site) then
    you're most of the way there. Keep in mind that the values returned by
    the PCF8583 are in BCD, so the value in the high nib of register 0 will
    change every 10th of a second. All you have to do is read this register
    and look to see if the high nibble changed.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: jelongus [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=QqHSI4dIaafIDNxSIfgYTUZfD1rG-bHmR4z_mNTItQq2195KRzcoDOlq1YePSsx-0cGUp-RmTI1T5tGOIIXSZA]propellanttech@c...[/url
    Sent: Tuesday, October 07, 2003 12:38 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: Sort of a newbie...could use some help!?


    Jon,

    I have read all types of different material from Phillips, as well as
    Nuts and Volts, and the Stampworks articles as well.

    I just don't seem to get the whole picture about using I2C with the
    PCF 8583.

    I'm a litle lost about the command structure. I have read so many
    things ....now I'm confused. All I want is for the RTC to tell the
    Stamp when 1/10th of a second has passed, but every attempt I
    make...gives me strange results. I tried to get the RTC to display
    (with debug) 100th's of seconds.....but the number is just 000 to
    009. It also moves the second digit,but so fast you can hardly notice
    it.

    That is the reason I came here. You guys probably understand the
    communication layout much better than I. I'm really lost when it
    comes to I2C. Doesn't make a whole lot of sense.

    Thanks,

    James



    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > Specifications for the I2C protocol are available on the Net from
    > Philips. The short story is that it is a synchronous (separate
    data and
    > clock lines), multi-drop buss. Devices on the buss are addressed by
    > type and unit (many I2C devices support more than one of the same
    device
    > type on the buss).
    >
    > The BS2p and BS2pe have built-in I2C commands, but you can bit-bang
    the
    > signaling using SHIFTOUT and SHIFTIN with other BS2 micros. I've
    even
    > heard that some people have written BS1 code for I2C. Now that I
    can
    > program my BS1 from Windows (in testing -- you'll get it soon too!)
    I
    > will give it a try.
    >
    > Take a look at our Nuts & Volts material -- you'll find Column
    #85 "I2C
    > Fun for Everyone" useful. You'll find it in the Downloads section
    of
    > our web site.
    >
    > If memory serves me, the PCF8583 has a 1 Hz output signal, so for
    your
    > project you'll need to poll the 1/100th seconds register and work
    from
    > there.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >



    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/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 20:02
    Jon,

    Could you give me a little snippet of what the command would look
    like, to get the High nib of the register. This is the main problem I
    think I'm having.

    Also....instead of having the stamp watch for the value...is it
    possible for the RTC to send an alarm when the register changes. I
    know there is an alarm feature....by the Phillips website.

    Like I said....I don't really understand all of the I2C protocol.

    Jon you are a gret resource to have around.

    James


    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > If you can read the device (and there is code on our web site) then
    > you're most of the way there. Keep in mind that the values
    returned by
    > the PCF8583 are in BCD, so the value in the high nib of register 0
    will
    > change every 10th of a second. All you have to do is read this
    register
    > and look to see if the high nibble changed.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-10-07 20:51
    This should get you started. It will read the PCF8583 (SDA on Pin0,
    Addr = 0) and when it sees a change in the high nibble of register 1 (I
    was mistaken about register 0 earlier) it will print an astersisk on the
    debug window. You can change that section to whatever you want
    triggered at 10 hertz.

    reg1 VAR Byte
    old10ths VAR Nib

    Setup:
    old10ths = $F

    Main:
    DO
    I2CIN 0, $A1, 1, [noparse][[/noparse]reg1]
    IF (reg1.HIGHNIB <> old10ths) THEN
    DEBUG "*"
    old10ths = reg1.HIGHNIB
    ENDIF
    LOOP


    Using the timer alarm output is quite a bit more involved, and requires
    another input pin. The PCF8583 specs go into the details.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office




    Original Message
    From: jelongus [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=alNF-u1bX8aqymzE8C-TWop6fZrlvPC7gbP5wjQnkigNaIvJ6A-vHNu4ctikCW6dT9NC2vIpw4kzMe8u5ua8RZP-Omx_]propellanttech@c...[/url
    Sent: Tuesday, October 07, 2003 2:02 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: Sort of a newbie...could use some help!?


    Jon,

    Could you give me a little snippet of what the command would look
    like, to get the High nib of the register. This is the main problem I
    think I'm having.

    Also....instead of having the stamp watch for the value...is it
    possible for the RTC to send an alarm when the register changes. I
    know there is an alarm feature....by the Phillips website.

    Like I said....I don't really understand all of the I2C protocol.

    Jon you are a gret resource to have around.

    James


    --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
    wrote:
    > If you can read the device (and there is code on our web site) then
    > you're most of the way there. Keep in mind that the values
    returned by
    > the PCF8583 are in BCD, so the value in the high nib of register 0
    will
    > change every 10th of a second. All you have to do is read this
    register
    > and look to see if the high nibble changed.
    >
    > -- Jon Williams
    > -- Applications Engineer, Parallax
    > -- Dallas Office
    >
    >



    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/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
Sign In or Register to comment.