Adventures in I2C Communications...


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Posts
    18

    Default Adventures in I2C Communications...

    Folks,

    I guess I have a hard time wrapping my head around the intricacies of I2C programming. I just cannot get it to work, and cannot seem to get any positive feedback from my Application to see where I am going wrong with this...

    I am working on a different project and cannot seem to get it working. Should be simple but...

    I am trying to communicate with another chip (NS73M Radio Transmitter) via I2C.

    I am using a 16F84A PIC as my master. the NS73M is the slave.

    What makes me think that I am not doing it correctly (or just dont understand it) is I have my Clock going to a PIN (B.2), and Data going to a Pin (B.1).

    In PBP, the manual states the syntax for I2CWRITE is:

    I2CWrite DataPin,ClockPin,ControlAddress,DestAddress,[Dest Value](,optional label)

    I tried using the optional label ("If the optional Label is included, this label will be jumped to if an acknowledge is not received from the I2C device.")

    But I can remove the clock connection, and it does not jump. I can remove the data connection, and it does not jump. I can remove BOTH clock AND data connections, and it does not jump.

    In fact, it will ONLY use the jump label IF I swap the data/clock connections. in other words, swap pins so PIC data out is connected to the NS73 Clock Input, and the PIC Clock is connected to the NS73 data input.

    Somehow, something isnt working right... at least , that is the impression I get.

    Can someone explain a little better what I should be looking for, so I can troubleshoot this a bit more competently?

    I am pretty much at a loss for this... Any assistance would be appreciated!!

    Cheers!

    SmugWimp

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Just curious, do you have pullup resistors on the I²C lines?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jan 2009
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Yes, 1K on each; Data and Clock, to +3.3v

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. Under communications, an I2C section.
    By blainecf in forum Forum Requests
    Replies: 4
    Last Post: - 26th July 2006, 19:59
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 13:55

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