explanation on I2C command (PBP)


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You're pretty much there... except...

    24LC32 has a BYTE as the Control Address and a WORD as the Memory Address.

    Without looking at the Datasheets for those two devices you quoted I can't say, but EEPROMs for example need the Memory Address, other devices (like the RTC or I/O Expander) don't so you omit it, however in many cases it is replaced by an internal REGISTER Address for the I2C Slave Device. Again refer to your Datasheet for your particular I2C Slave device.

    Example for DS1307 RTC...

    I2CAddress=$D0 ' Device Address
    I2CRegister=0 ' Get Seconds Register
    I2CRead SDA,SCL,I2CAddress,I2CRegister,[DataA],I2CDataError

    If swimming in marmalade - bring some toast...

  2. #2
    Join Date
    Mar 2008
    Posts
    59


    Did you find this post helpful? Yes | No

    Default Re: explanation on I2C command (PBP)

    Melanie

    I am having a time with the RDA1846, the data sheets says the 7 bit control address is 1110001 plus a read/write bit does I2CWRITE add this read/write bit in the proper place or do I need add it to the control address? It also says it should be sent MSB first is this how I2CWRITE handles this control byte? I am very confused !

    ADDRESS VAR BYTE
    DATAH VAR BYTE
    DATAL VAR BYTE
    I2CWRITE DATAIO,CLOCK,%1110001,ADDRESS,[DATAH,DATAL]

    Thanks You!
    https://dallasmakerspace.org/w/image...ing_manual.pdf "Page 5"

Similar Threads

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

Members who have read this thread : 0

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