Another I2CWRITE problem


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    Ah ha! The 'data' portion of the transfer needs brackets. Otherwise the compiler accepts them as good but doesn't issue the I2C stop condition.

    Another "feature" of PBP, a silent compile error.


    Bob:

    On the 16F88, PortB.1 and PortB.4 are used for I2C . (Datasheet!) B1 is the data line and B.4 is the clock line.
    That would be true if PBP used the internal hardware for I2C. It doesn't, it just bit bangs the ports (well, actually the tris registers so it can do open collector type outputs). If you skim down a disasembly listing or memory listing (something MPLAB will get for you if you load both the hex and cod files) you'll see it doing this.

    I did not used the hardware I2C for several reasons, mainly I don't want hardware I2C support to be a PIC choice requirement.

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi ErnieM,

    I honestly did not know that there was both a hardware and a software I2C setups on PICs similar to serial. But, that's why were here isn't it? To learn! Here I am searching for PICs that have I2C pins when I could have used maybe something different. Thanks for the additional knowledge.

    BobK

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


    Did you find this post helpful? Yes | No

    Default

    HPWM, HSERIN, HSEROUT will use the PIC dedicated pin as it use the internal Hardware module. SERIN/SEROUT/I2CREAD/I2CWRITE/SHIFTIN/SHIFTOUT are a software solution and may be used on almost any i/o of your PIC.

    Maybe one day we will have HI2CREAD/Hi2CWRITE/HSHIFTIN/HSHIFTOUT, in the meantime, we used those we spend hours/days/months on.
    Steve

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

  4. #4
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Thanks Mr E for the education. That's what I like about this place! Always something to learn.

    BobK

Similar Threads

  1. I2CWRITE problem
    By Art in forum mel PIC BASIC Pro
    Replies: 35
    Last Post: - 29th January 2010, 03:01
  2. My I2CWRITE - timings and tricks
    By FinchPJ in forum Code Examples
    Replies: 5
    Last Post: - 3rd March 2008, 21:40
  3. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th June 2006, 20:03
  4. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th June 2006, 18:32
  5. I2CRead / I2CWrite Problem?
    By koossa in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st October 2005, 18:26

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