Interfacing two PIC micros


Closed Thread
Results 1 to 13 of 13
  1. #1
    Join Date
    May 2007
    Posts
    3

    Default Interfacing two PIC micros

    Hi all,

    I ve already interfaced 16F870 to RTC chip DS1307. After a few problems, its running fine now.

    Now, I am trying to interface to independently running PIC micros, both 16F870. But facing a few difficulties, like :

    i) what should be the read/write address for the slave PIC

    ii) How can we define variables in a particular memory location (in slave PIC), using Picbasic because DIM statement creates variables, but memory location is not known to the user.

    iii) How to define SDA and SCL pins on the slave PIC.

    I think, I need all the information for interfacing two PICs, using Picbasic.

    Kindly help me and oblige.

    Thanking you all in anticipation.
    Regards,
    Sajid

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sajid View Post
    ii) How can we define variables in a particular memory location (in slave PIC), using Picbasic because DIM statement creates variables, but memory location is not known to the user.
    Good luck DIM'ing anything in PicBasicPro.
    Check Proton Basic forums instead.

  3. #3
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Talking

    Good luck DIM'ing anything in PicBasicPro.
    Check Proton Basic forums instead.

    I DIMmed a light using the X10 commands once!

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ron Marcus View Post
    Good luck DIM'ing anything in PicBasicPro.
    Check Proton Basic forums instead.

    I DIMmed a light using the X10 commands once!
    Good one...
    Come to think of it, I've DIMmed a whole load of LEDs using PBP too...

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Ah come on guys! This is his first post here and he need help... you can't help him, then just shut the ******

    Sajid, are you using Melabs PICBasic, Melabs PicBasic PRO or Crownhill Proton (PDS) ?

    If you're using Crownhill Proton (PDS) you'll need to go on their forum.
    www.picbasic.org/forum

    yeah.. both are known as PicBasic...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    This might be of use.

    Is there a way to do what sajid ask in PBP?
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yes, everything is possible. I don't know if i would use the MSSP port and share everybody on the same bus, or use a serial communication so far.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Yes, everything is possible. I don't know if i would use the MSSP port and share everybody on the same bus, or use a serial communication so far.
    I have never thought about MSSP. Looks like something fun to try some day.

    Thank you
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Fun, fast and handy, that's for sure.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #10
    Join Date
    May 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Smile

    Thanks guys, for atleast replying to my query.

    Sorry, for that DIM thing....its my first post, remember that. (Thanks, mister_e )

    Im using Crownhill Proton, I wud ask them, about DIMming anything....

    OK......lets forget that. Now I want to do it in PBP. Can anybody help me in my queries, for interfacing two PICs, like,

    i) what should be the read/write address for the slave PIC

    ii) How can we define variables in a particular memory location (in slave PIC), using PBP

    iii) How to define SDA and SCL pins on the slave PIC.

    Thanks all for the response (good or bad), I appreciate that. Now, experts, please help me with this.

    Regards,
    Sajid

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sajid View Post
    i) what should be the read/write address for the slave PIC
    It's whatever you program the slave PIC to respond to.

    ii) How can we define variables in a particular memory location (in slave PIC), using PBP
    PBP manual, Section 9.3, 'Interrupts in Assembler' has some good hints on how to set a specific variable to a specific location...but I wouldn't count on it. Easier (in my mind) to let PBP assign a location for you, then you program around it.

    iii) How to define SDA and SCL pins on the slave PIC.
    You realize PBP only supports I2C master modes, not slave modes. The PIC itself, if so equipped, can use I2C in a slave mode, but you have to program that manually, PBP won't help much in that respect. There is a few web pages out there with good PIC I2C slave code, don't remember where they are, don't have them bookmarked, but I've seen them.

    Now, experts, please help me with this.
    I know that's not some sort of DEMAND...like somebody owe's you something. You'd be much more likely to get some help if YOU wrote some code YOURSELF and pointed out where YOU are having trouble.

    EDIT: Got this from a Google search for 'PIC I2C slave'
    http://www.astrosurf.com/soubie/pic_as_an_i2c_slave.htm
    1st link. Was that so hard?
    Last edited by skimask; - 25th May 2007 at 07:22. Reason: edit: added I2C slave link

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  13. #13
    Join Date
    May 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Smile

    Thanks, Skimask.
    Thanks, Steve.

    Skimask Sir, I am sorry about that 'expert' line. Since everyone took my query lightly, so I was bit frustrated. I sincerley apologize.

    The links and tips provided by you and Steve, are really helpful.

    I will certainly keep informing you all, as I work on it.

    Thanks to you all, again.

    Regards,
    Sajid

Similar Threads

  1. TTL(i) or CMOS for interfacing to PIC?
    By Elnino in forum Off Topic
    Replies: 0
    Last Post: - 16th September 2009, 01:35
  2. Interfacing DS1603 to PIC 16F877
    By hackableFM in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th February 2009, 21:37
  3. PLC Interfacing with PIC
    By skian85 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 19th June 2008, 23:05
  4. PIC interfacing with FTDI's VDIP1
    By Vidya in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th May 2008, 17:02
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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