I2C Slave with a PIC


Closed Thread
Results 1 to 40 of 130

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: I2C Salve with a PIC

    Hi Charles, thanks for sharing..I will try it out..


    tacbanon

  2. #2
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: I2C Salve with a PIC

    @Charles
    Sorry I was not able to make it work on my setup..I'm not really sure what the following code is doing, so I tried to comment it and assign a value, but no effect.
    Code:
    I2CMajorAddress     CON $3
    I2CDeviceAddress =  $8     
    'I2CAddress = (I2CMajorAddress <<4) | I2CDeviceAddress 
    I2CAddress =$14
    I hope it will be alright if you share the master side code?

    Thanks,
    tacbanon

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


    Did you find this post helpful? Yes | No

    Default Re: I2C Salve with a PIC

    At this point, I'm thinking Al (aratti) was right.

    AN734 didn't work either.
    Bytes are being put in the SSPBUF without an address match.
    So the slaves that aren't being accessed are overflowing during reads from other devices.

    The code I gave earlier works because it's resetting the overflow in the main loop, but that's just not right.

    I'm trying to get some more info from Labcenter.
    DT

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: I2C Salve with a PIC

    I am using a slight variant of the code I posted, and it is working fine. The only major change is that I'm sending a packet length byte, and I'm handling the entire receive packet inside the ISR. This is safe because I have my ( higher priority) timer interrupt watching over the whole process.
    Charles Linquist

  5. #5
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: I2C Salve with a PIC

    Hi,
    Just want to ask if anyone tried to extend say 50meters communication between master and slave using I2C bus extender P82B715PN or similar?

    Regards,
    tacbanon

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


    Did you find this post helpful? Yes | No

    Default Re: I2C Salve with a PIC

    tacbannon,

    The problem with Proteus and multiple I2C slaves has been fixed by Labcenter.
    If you update Proteus to 7.10 SP1, you should have better luck.
    DT

  7. #7
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: I2C Salve with a PIC

    @ DT, Thanks for the update..I will find time to play with it(I2C multiple slaves) this weekend(so many work, little time to play )

    Kind regards,
    tacbanon

Similar Threads

  1. Problem with PICto PIC I2C MASTER-SLAVE
    By juanen19 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th June 2013, 03:58
  2. PIC as I2C Slave
    By Mainul in forum General
    Replies: 4
    Last Post: - 5th January 2013, 14:23
  3. I2C Slave, config Vref - + in pic with ADC
    By sebapostigo in forum PBP Wish List
    Replies: 4
    Last Post: - 5th March 2007, 04:21
  4. Pic as an i2c slave
    By Robert Soubie in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th January 2007, 22:11
  5. Use pic as slave in I2C
    By robert0 in forum General
    Replies: 2
    Last Post: - 3rd February 2006, 20:26

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