Beginner I2C Questions


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169

    Default Beginner I2C Questions

    I have a PIC18F13K50 (Master) which I'm trying to transmit some I2C commands to a DTMF chip (PCD3312 - Slave).
    The processor has an inbuilt 16Mhz oscillator so I assume I include a "DEFINE I2C_SLOW 1" declaration to operate the I2C in standard 100KHz mode? Do I need to set any additional I2C timing registers directly through the processor or does PBP look after that?
    What are the suggested resistance values for the data and clock lines for I2C?
    Do I need to set these pins to digital inputs or just inputs?

    Thanks for any help,

    Troy

  2. #2
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169

    Default Re: Beginner I2C Questions

    Oops:
    What are the suggested resistance values for the data and clock lines for I2C?

    should read: What are the suggested pull up resistance values I should use for the data and clock lines for I2C?

    Thanks,

    Troy

  3. #3
    Join Date
    Jan 2012
    Location
    Grid EN19MV
    Posts
    159

    Default Re: Beginner I2C Questions

    Quote Originally Posted by rocket_troy View Post
    Oops:
    What are the suggested pull up resistance values I should use for the data and clock lines for I2C?
    4.7K There's a good diagram in the manual - look at the I2CREAD command.

    I've never bothered with I2CSLOW - PBP seems to set up all the registers by itself and it works fine.

    Good luck!
    "I have noticed that even those who assert that everything is predestined and that
    we can change nothing about it still look both ways before they cross the street"


    -Stephen Hawking

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604

    Default Re: Beginner I2C Questions

    Hi,
    I've never actually done anything with I2C so I'm no expert - by far.
    But, in case there's some confusion, the I2READ / I2CWRITE commands are both bit-banged routines meaning they do not use the I2C peripheral (the MSSP-module) built into several PICs. This means that there really are no registers to setup except enabling the pin to work as a digital I/O, ie. make sure any analog functions are turned off on the pins in question. It also means that you can use "any" pins for the I2C-lines, not only those designated SDA and SDL in the datasheet - those are for the MSSP module which I2CREAD/I2CWRITE doesn't use.

    /Henrik.

  5. #5
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169

    Default Re: Beginner I2C Questions

    Thanks for that guys! I'm really glad I asked! Your intuition was spot on Henrik, I was under the naive impression PBP used the MSSP module of the PIC.

    Cheers,

    Troy

  6. #6
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    169

    Default Re: Beginner I2C Questions

    Henrik and co,
    Just to clarify, do I need a port with digital I/O capabilities to function for PBP's I2C communications or can I use a digital input only port? I'm using the PIC micro as the master only.

    Thanks,

    Troy

Similar Threads

  1. Beginner help!
    By Recognize in forum General
    Replies: 14
    Last Post: - 26th April 2012, 14:55
  2. I2C howto questions
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 27th May 2010, 18:39
  3. i2c PBP questions
    By TimV in forum General
    Replies: 14
    Last Post: - 5th February 2007, 17:58
  4. Questions about i2C EEPROM
    By RunningMan in forum General
    Replies: 3
    Last Post: - 29th January 2007, 04:09
  5. Still new to PicBasic - i2c questions
    By cometboy in forum mel PIC BASIC
    Replies: 4
    Last Post: - 13th November 2006, 18:27

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