I2C with 8564 RTC


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2005
    Location
    Auckland/New Zealand
    Posts
    19

    Default I2C with 8564 RTC

    Hi,
    I'm using I2C command with 8564 RTC .
    I2Cwrite is working ok.
    I2CREAD is not giving me what I want.

    ADCON1=127
    sda var portb.4
    scl var portb.5
    dt var byte
    I2Cwrite sda,scl,$A2,$0D,[80] 'write 80 hex in register 0D.
    I2Cread sda,scl,$A3,$0D,$A2,[dt] 'This command should put 80 hex in dt
    write 0,dt 'this puts dt i.e.80 hex in EEPROM location 0.

    according to the datasheet of 8564 I2CREAD should be written as above control address (read) ,reg address ,control address (write).

    When compiling the above patch, no error appears in PBP.
    Can you suggest where the problem is or how I can modify/rewrite/rearrange I2CREAD.
    Processor is 18F1320. PBPv2.46 ,IDE MCSP
    Thanks
    Suded.

  2. #2
    Join Date
    Apr 2005
    Location
    Auckland/New Zealand
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    RTC is RX-8564 EPSON with built in XTAL 32.768 kHz.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    This might help ...

    I2CRead & I2CWrite not working as expected
    http://www.picbasic.co.uk/forum/showthread.php?t=587
    <br>
    DT

  4. #4
    Join Date
    Apr 2005
    Location
    Auckland/New Zealand
    Posts
    19


    Did you find this post helpful? Yes | No

    Default I2cread

    Hi Darrel,
    Thanks for your reply.
    I checked the thread you suggested it has only I2Cwrite.
    I aslo found some good software in Reynolds(Rentron) website for I2C comm. but that uses individual subroutines SHIFTIN,SHIFTOUT it will be good if the I2CREAD command can do the job by itself & will be more compact.
    The Reynolds software deals with the same sitution that I have.
    Regards.
    Suded.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by suded View Post
    I checked the thread you suggested it has only I2Cwrite.
    That's true, she only used I2CWRITE in the examples.

    But the problem she was describing applies to both I2CWRITE and I2CREAD.
    And that problem is also in your code. (along with some extra stuff)
    <br>
    DT

  6. #6
    Join Date
    May 2008
    Location
    Florida
    Posts
    64


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by Darrel Taylor View Post
    This might help ...

    I2CRead & I2CWrite not working as expected
    http://www.picbasic.co.uk/forum/showthread.php?t=587
    <br>
    Darrel

    You pointed me to the answer to my question before I asked. Man are you GOOD!

    1. It pays to read all threads even if they are not about something you are doing or your own thread.

    Was going to ask how to capture a broken wire, missing I2C device in a I2CRead.

    F1CHF asked and answered it in the #2 post.

    THANK YOU Darrel and F1CHF. and suded too.

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  4. X1226 RTC - Help
    By charudatt in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th August 2006, 17:54
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts