A little help with I2C and PICBASIC Pro


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

    Question A little help with I2C and PICBASIC Pro

    Hi all,

    I'm a bit new. I just purchased a PICBASIC Pro compiler and was skimming through the manual regarding I2C. It said something about the timing is set so that standard speed devices are accessible at clock speeds up to 8MHz and fast mode devices may be used up to 20MHz.

    I just wanted to confirm that this statement allows me to use, say, a PIC12F675 (20MHz clock input) with a peripheral I2C device (400 kHz speed) other than a serial EEPROM without having to use another IC to interface between the two. In other words, by configuring the connection, I can just hook the two ICs together (?).

    Thanks!

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


    Did you find this post helpful? Yes | No

    Default

    Qacer, That is correct. And if you have a slower I2C device you can have the I2C bus operate at 100Khz by using the defive stastatement "DEFINE I2C_SLOW 1".

    Dave Purola,
    N8NTA

  3. #3
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks, Dave! Have you had some experience dealing with I2C devices? I was curious because I wanted to ask for some design tips as far as interfacing the I2C device and the PIC physically.

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


    Did you find this post helpful? Yes | No

    Default

    Qacer,Yes I have had experence in interfacing different devices via I2C. I have used in the past 24LC64/24LC128/24LC256/24LC515/LM95071/LM95231 and various other I/O I2C interfaces. I have found that all you need to do is make sure the address pins of the devices are set correctly, use no more than 4.7k pullup resistors on the SCL/SDA lines and make sure that the VCC is clean going to the I2C device especially if is doing any analog conversion ie.temperature or voltage. Make sure the control variable "if used for passing address information" has the least significant bit unused, Also make sure the variable used for addressing ie.memory is of the correct size, meaning byte or word. Other than that I have had no problems in the last 6 years using I2C devices with PIC processors. Just connect em up and have a ball...

    Dave Purola,
    N8NTA

  5. #5
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks again, Dave!

    What PICs have you used for 400kHz I2C devices?

    Right now, I'm trying my hand at the PIC12F675. I'm looking through the manuals to determine whether I can set the PIC oscillator at 4MHz and still be able to communicate with 400KHz I2C devices.

    Using PICs is starting to be fun, I'm just at the beginning stage so I haven't really had any applications built. I already have a couple in mind that I want to try, but I need to familiarize myself with the PIC family to figure out how to implement it.

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


    Did you find this post helpful? Yes | No

    Default

    Qacer, I have used 16F84,16F88,16F876,16F877,18F252,18F452,18F1320,18 F2620 and 18F8722's
    with out any problems running atleast 20 Mhz oscillator.

    Dave Purola,
    N8NTA

  7. #7
    Qacer's Avatar
    Qacer Guest


    Did you find this post helpful? Yes | No

    Talking

    Thanks again, Dave!

Similar Threads

  1. I2C Slave with a PIC
    By ralfmayr in forum mel PIC BASIC Pro
    Replies: 129
    Last Post: - 21st August 2016, 17:44
  2. HI2CREAD for 18Fs
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 27th October 2008, 09:50
  3. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  4. Still new to PicBasic - i2c questions
    By cometboy in forum mel PIC BASIC
    Replies: 4
    Last Post: - 13th November 2006, 18:27
  5. Anyone have ADS1100 I2C PicBasic Pro code example
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th March 2006, 22:13

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