My I2CWRITE - timings and tricks


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,129


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by FinchPJ View Post
    ...
    I2CWRITE SDA, SCL, $A0, 0, [Buffer\64]
    is illegal and wont work - just please use variables ONLY (not constants).

    .....

    I2CWRITE SDA, SCL, %10011000, %00010000, DAC
    Hi Peter.
    On the first example you state that it won't work because of the constants. But on the second example you are using constants! Now I got confused. Does it work or not? From my experience the control may well be a constant.

    Ioannis

  2. #2
    Join Date
    Jun 2005
    Location
    Surrey, England
    Posts
    35


    Did you find this post helpful? Yes | No

    Default Correction

    Well spotted - I apologise I was not as rigorous as I should have been - of course that was a throwaway comment on a topic already well documented in this forum. You are correct I am using a constant for the control byte - This is OK! If I had been more rigourous I would have been more specific and said please dont use constants for the Address when using a memory chip - that MUST be a variable - as per the PBP manual:

    The Address size sent (byte or word) is determined by the size of the variable that is used. If a byte-sized variable is used for the Address, an 8-bit address is sent. If a word-sized variable is used, a 16-bit address is sent. Be sure to use the proper sized variable for the device you wish to communicate with. Constants should not be used for the address as the size can vary dependent on the size of the constant. Also, expressions should not be used as they can cause an improper Address size to be sent..

    Of course these contraints do not apply to talking to the DAC, although I could have used byte variables.

    Peter Finch

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,129


    Did you find this post helpful? Yes | No

    Default

    OK. We agree totaly.

    Ioannis

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