Need help defining I2C and Serial pins


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2007
    Location
    Mississauga, Ontario, Canada
    Posts
    29

    Default Need help defining I2C and Serial pins

    Hi all..

    I'm just getting into PIC programming and currently working on a little gizmo that will communicate with a computer as well as a Real Time Clock using I2C.
    I've got a pile of 16F84 PIC and I'm well aware that they're pretty obsolete now, however I would like to put them to a good use.
    I'm having trouble finding any info on which pins can be used for serial (RS232) and I2C communications. Seems that every schematic I see uses different ports for that purpose, does that mean that you can actually assign ports to perform these functions (unlike the 68HH11 that has fixed ports to do this and that).

    I'm using Microcode studio to write the projects that makes the communications easy, however I'm still a little confused as to how to go about determining which pins are to be used for all this.

    Any help would be greatly appreciated.
    Thanks

    Alex

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


    Did you find this post helpful? Yes | No

    Default

    If you use SERIN/SEROUT or SERIN2/SEROUT2 any pin configures for I/O will work for serial comms.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2007
    Location
    Mississauga, Ontario, Canada
    Posts
    29


    Did you find this post helpful? Yes | No

    Default

    Thanks for the info Dave...
    Does this apply to I2C communications as well?

    If so, how does one assign I2C and Serial TX/RX functions to specific pins on the 16F84 using Microcode Studio?

    thanks
    Alex

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


    Did you find this post helpful? Yes | No

    Default

    PBP has I2CREAD and I2CWRITE commands built in. Look in the manual on how to set one up.

    But the answer to your question is
    Code:
    I2CREAD PORT?.?, the rest of the statement
    SERIN PORT?.?, the rest of the statement
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Aug 2007
    Location
    Mississauga, Ontario, Canada
    Posts
    29


    Did you find this post helpful? Yes | No

    Default

    Thank you very much Dave... appreciate your help.

    Alex

  6. #6
    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 Navaidstech View Post
    Thank you very much Dave... appreciate your help.

    Alex
    No problem, been there myself. On second thought I am still there
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. I2C Slave with a PIC
    By ralfmayr in forum mel PIC BASIC Pro
    Replies: 129
    Last Post: - 21st August 2016, 17:44
  2. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  3. MCP23016 I2C serial I/O expander chip
    By GeoJoe in forum Serial
    Replies: 7
    Last Post: - 31st October 2007, 15:39
  4. pc to pic serial comm and i2c eeprom
    By elektroline in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd November 2006, 05:51
  5. HSERIN and I2C ?
    By cpayne in forum Serial
    Replies: 0
    Last Post: - 12th October 2005, 03:51

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