I2C function... clock pin?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Qacer's Avatar
    Qacer Guest

    Question I2C function... clock pin?

    Hi all,

    Does PICBasic Pro generate the I2C clock signal with the I2CRead and I2Cwrite function? Or do I need to connect the clock in of the I2C device with the clock out of the PIC12F675?

    My main curiousity is that I want to know if I can just assign any clock pin using the I2C functions.

    Thanks!

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Qacer, The Pic micro produces the clock for the read and write operation. You can use any pin available on the Pic micro for the clock pin. Just make sure you use a pullup resistor on this pin as well as the data pin. Approx. 4.7K Ohms.

    Dave Purola,
    N8NTA

  3. #3
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Question

    Thanks again, Dave!

    In regards to pull-up resistors, I was reading Microchip's Getting Started: I2C Master Mode. They have a slide that shows suggested Pull-up values. They have 4.7k (less than 4.7 kbps), 2.2k (100 kbps), and 1k (400 kbps). What data rate have you achieved using 4.7k?

    I'm just curious to see if Microchip's values seem pretty reasonable.

    Thanks!

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Qacer, The resistor values you have mentioned are correct. The equipment I design is battery powered and I have not had any problem communicating with 24lc515 eeprom's @ 400 Khz with 4.7K resistors for the pullup. I however would not use anything bigger than that. Also I use the I2C bus on the PCB only but with smaller resistors you could use this bus for somewhat longer runs. If you can afford the current draw, it is best to use approx. 2.2K Ohms.

    Dave Purola,
    N8NTA

  5. #5
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Talking

    Thanks again, Dave!

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 22:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07

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