i2c clock speed on 16F887


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2010
    Posts
    5

    Default i2c clock speed on 16F887

    Hi,

    I'm running a 16F887 with an I2C connection to a DS1307. It's all working fine, but the clock is running at about 50kHz. I'm using the internal 8MHz oscillator on the 16F887, and (I think) have the right DEFINEs...

    ; Set Clock to 8KHz
    OSCCON = %01110001
    DEFINE OSC 8 ; tell PBP about clock speed


    Am using PBP 2.47. Any ideas what the problem might be? Being able to do the transfer twice as quickly would help me out.

    thanks in advance,

    ...rob

  2. #2
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Are you using the s/w bit bang command, or the hardware bus commands? That's about as fast as the s/w commands can go.
    Have you tried reducing the values of your pullup resistors? Dropping down to 5k or less can sometimes reduce the transition times, and it is especially helpful if they are "on the fence" as far as timing goes.

  3. #3
    Join Date
    Apr 2010
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    Thanks very much for the response. I'm using I2CREAD - I'd assumed that since I was using the right pins on the PIC it was using the hardware feature, but it looks like that's not the case. I guess there's no way to use the hardware from picbasic and you have to do it in assembler...?

    I guess the other alternative is to crank the clock speed up..?

    I'm using 4k7 pullups by the way.

    thanks again,

    ...rob

    Quote Originally Posted by tenaja View Post
    Are you using the s/w bit bang command, or the hardware bus commands? That's about as fast as the s/w commands can go.
    Have you tried reducing the values of your pullup resistors? Dropping down to 5k or less can sometimes reduce the transition times, and it is especially helpful if they are "on the fence" as far as timing goes.

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