I2C optional label question


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Are you using two different addresses (one for write and one for read)?


    WriteAddress %xxxxxxxxx0
    ReadAddress %xxxxxxxx1

    Were: %xxxxxxx is the binary device address.

    Al.
    All progress began with an idea

  2. #2
    Join Date
    Jan 2005
    Location
    France
    Posts
    97


    Did you find this post helpful? Yes | No

    Default I2C question

    Yes
    I try @C2 and @C3
    the write address is @C2 and it works
    for the READ I use both (to see what happens !)
    because friends told me that they use @C2 and it works
    they told me that PBP add 1 on the address value in a read command ?
    That why I try both ...
    May be my problem is that I am using a VIDEO sender done for 2400 Mhz range
    and I use it on 2335 Mhz (amateur band) and the varicap level is low (near 1,15 volts)
    I will try to set up on 2400 Mhz and see what happen ...

    by the way, have you an idea about the Optionnal Label on I2C command
    is it a GOTO or a GOSUB for you ?

    thanks

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    by the way, have you an idea about the Optionnal Label on I2C command
    is it a GOTO or a GOSUB for you ?
    As I told you in post#2 is a GOTO comand.

    You can put a flag=0 before the I2Cread or I2Cwrite and use the label to direct to a TimeOut label, where you change Flag=1. In this way you will know if you had a timeout problem and discard the reading or writing and redo the process.

    Al.
    All progress began with an idea

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Are you aware that the ADDRESS and the CONTROL should be a variable and NOT a constant? Leave bit 0 clear of the CONTROL byte... the I2C routines will use it internally.

  5. #5
    Join Date
    Jan 2005
    Location
    France
    Posts
    97


    Did you find this post helpful? Yes | No

    Default I2C question

    Hi Melanie, still on board, super ! and working on Sunday time !
    Aratti .. sorry, I didn't see the word GOTO ...thanks ..
    It is clear for me, that the control and address parameters are confusing for me ...
    I understand from the example, this is used with Eprom familly
    Control parameter is the main address
    and
    address parametre is used to point to the address location in the Eprom !

    I use for long time I2C commands in the simple way like
    I2CWRITE DataPin,ClockPin,Control,{Address,}[Value{,Value...}]{,Label}

    example :

    datapin var PORTA.1
    clockpin var PORTA.2
    Main:
    I2CWRITE datapin,clockpin,$C2,[11,22,33,44],errorI2C
    etc ...
    etc ...

    errorI2C:
    flash a led ....
    goto Main

    As I do not understand Control and address story, I always use this and It works
    with a lot of synthetisers (SP5055 familly)
    Now I decided to be more serious ! and check the frequency lock flag
    (bit 6 of the SP 5055 register)
    that why I try to READ like that
    flag var byte
    I2CREAD datapin,clockpin,$C3, [flag], errorI2C
    if flag.6 = 1 then continue
    else
    goto main
    endif

    continue:
    etc ...
    etc ...

    nb: $C2 or $C3 I am not sure, but I can check the good value ..

    thanks for your help

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    You did not understand my post... don't use CONSTANTS but use VARIABLES with I2C commands....

    ControlByte var BYTE

    .. ..

    ControlByte=$C2
    I2CREAD datapin,clockpin,ControlByte, [flag], errorI2C

  7. #7
    Join Date
    Jan 2005
    Location
    France
    Posts
    97


    Did you find this post helpful? Yes | No

    Talking I2C question

    Hello Melanie, morning ..
    Oupps ...I will trust you as usual
    I will test it today
    thanks

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 23:14
  2. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 23:31
  3. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 22:07
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 20:33
  5. 18F452 "Unknown Processor" errors
    By schwinn_rider in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th April 2006, 04:56

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