Hardware I2C


Results 1 to 12 of 12

Thread: Hardware I2C

Threaded View

  1. #4
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    I don't know what PIC you are using, so I can't promise anything, but I've attached a file containing some portions of code I have used with the hardware I2C on a PIC 18F4620.

    The file is a compilation of cut and past from a few include files, and has only been minimally "cleaned up" for public viewing. It has 4 sections:
    1) Basic PIC and HSEROUT setup (mostly to reinforce what pic and how it's configured)
    2) The meat of the I2C commands
    3) Samples of Large Block Reading/Writing to an EEPROM
    4) Samples of Reading/Writing to an RTC

    Hopefully this will get you started.
    Best of luck,
    Steve B

    Disclaimer: Looking a little closer I recall this being one of my first PBP-ASM items I tackled. It worked, and with other things pressing, I haven't gone back and cleaned things up, like unused variables (DelayCtr1 and DelayCtr2) and rements of HSEROUT commands used to debug.
    Attached Files Attached Files
    Last edited by SteveB; - 20th January 2007 at 06:50. Reason: Added disclaime

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. Hardware I2C
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 21
    Last Post: - 13th March 2008, 14:24
  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 : 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