Connect with us

I2C control.

Discussion in 'Electronic Design' started by Boki, Feb 28, 2006.

Scroll to continue with content
  1. Boki

    Boki Guest

    Dear All,

    On my understanding, and the function call that chip supplier provides
    to me:

    ABC_IICWrite(1, 0x1A); // write 0x1a to register 1.

    It seems that:
    1. I2C device can't support more then 255 registers. ( due to only 1
    byte for register assigment. )
    2. I2C device only accept 1 byte data a time. ( it is my guess only,
    due to the function call accepts 1 byte only and that is not a pointer
    ).

    am I right?

    BR/
    Boki.
     
  2. Paul Burke

    Paul Burke Guest

  3. Boki

    Boki Guest

    : )

    BR/
    Boki.
     
  4. Boki

    Boki Guest

    ; )

    BR/
    Boki.
     
  5. Pooh Bear

    Pooh Bear Guest

    Most I2C devices allow auto-address incrementing sequential write and
    read operations. What's the device ?

    Maybe the programming language you're using doesn't have a relevant
    procedure ?

    Graham
     
  6. CBFalconer

    CBFalconer Guest

    Totally incomprehensible. Read my sig and the references below.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    More details at: <http://cfaj.freeshell.org/google/>
    Also see <http://www.safalra.com/special/googlegroupsreply/>
     
  7. Yvan BOURNE

    Yvan BOURNE Guest

    Hi,
    I think your command is : "write 1 to slave 0x1A"
    It's not "register" but slave. Each IIC peripheral has an unique slave
    address, in your cas, 0x1A.
    And yes, only one byte in each transfer (8 bits of clocks + 1 ack).
    Have a look at the specification to understand how IIC is build.

    Yvan
    --

    ******************************
    YBDesign
    http://www.ybdesign.fr
    ******************************
     
  8. Boki

    Boki Guest

    Ya, I think you are right.

    BR/
    Boki.
     
  9. Not really.
    The first byte sent in an I2C transaction, is a _device address_, not a
    _register address_. It only occupies the top seven bits of the number
    sent, with the bottom bit being the 'direction control' marker.
    This byte, can then be followed by one or more 'register address' bytes.
    On an EEPROM for example, two bytes are used. What is implemented here, is
    completely up to the device.
    Some chips will implement multiple devices, in a single chip (many DAC
    converters to this), so you could then, using a two byte register address,
    potentially access 8388608 seperate registers in a single device (using
    all seven device address bits).
    Some older devices, implemented a 16 bit access modes, but the bus is
    really only 'one bit' at a time, so the only difference here is that there
    is only a single ACK. Such modes are reverse compatible, since master
    devices implementing 8 bit transfers are the most common form, and the
    device simply doesn't acknowledge till the end of the second byte. The
    biggest difference, is that the register address, can give twice the total
    amount of space accessible in this mode. These devices have largely fallen
    out of favour, since 8 bit transfers are more 'standard'.
    The function you have, has probably been written for a single specific I2C
    device, perhaps something like a 2Kbit EEPROM, where only a eight bit
    address ould be needed.

    Best Wishes
     
  10. Just a thought - clearly you don't use a newsreader that supports threads.
    Why not?

    Steve
    http://www.fivetrees.com
     
  11. CBFalconer

    CBFalconer Guest

    Clearly you don't understand how Usenet works, and how readers deal
    with read threads, etc.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    More details at: <http://cfaj.freeshell.org/google/>
    Also see <http://www.safalra.com/special/googlegroupsreply/>
     
  12. Errrr.... pardon? What a strange thing to say. I was merely pointing out
    that every major newsreader I've used supports threading of messages. I'm
    not talking about Google Groups, I'm talking about true Usenet [1] clients.
    (On this machine I'm currently using Outlook Express, but I've used a fair
    few others both under Windows and Unix.)

    As I said, you're apparently using a newsreader that doesn't. Why not use a
    more appropriate tool?

    [1] JWZ provides a decent summary of the revelant RFCs at:
    http://www.jwz.org/doc/threading.html

    Steve
    http://www.fivetrees.com
     
  13. I am using OE too but..... I have set it to hide read messages. So when Boki
    answers without context, I still cannot see to whom he is replying. To see
    that, I would have to go through menus first to enable displaying of read
    messages.

    Meindert
     
  14. Understood. Please don't misunderstand me - old hands like us know that
    providing context is considered good manners. It's just that I've long since
    given up being irritated by those who don't - life's too short - and the
    tools are available to provide context if one wishes.

    Steve
    http://www.fivetrees.com
     
  15. CBFalconer

    CBFalconer Guest

    A glance at the headers exposes the newsreaders involved. Your
    conclusions are wrong. However I only display unread messages in
    threads with unread. At the same time there is never any guarantee
    that any other message in a thread will arrive here, or anywhere
    else, before or even after the sort of silly contextless message
    that google encourages.

    Even if the other messages are available on my machine, it is a
    pain to abandon the one being read, and to search back in a thread
    for what should have appeared as context. Even if done, it then
    becomes awkward to return to the message in question. And that is
    with a good newsreader.

    I read in excess of 20 newsgroups, some quite busy. This foolish
    google interface is the biggest single pain on usenet now, it even
    precedes topposting and trolling.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    More details at: <http://cfaj.freeshell.org/google/>
    Also see <http://www.safalra.com/special/googlegroupsreply/>
     
  16. I found that the library functions provided sometimes have disasters hidden
    inside (like an infinite loop looking for a status bit change) and that it
    is not difficult to rewite them to be more intelligent.
     
  17. Again, a strange comment. I had offered no conclusions. I was merely
    pointing out that tools are available to provide threading.
    How you use your newsreader is obviously up to you. My original question was
    genuine - why not use threading? It works ok for me. (And yes, I realise
    that news distribution can be weird.)
    I've not used the Google interface, so can't comment on that. But again -
    contextless messages, topposting, and even trolling don't particularly
    bother me - I ignore trolls, and accept that not everyone is versed in
    Usenet-fu. That's life.

    You seem to have made it a personal mission to educate all the
    transgressors. Ok, that's your call. But it does generate a lot of noise. Do
    you really prefer noise to the occasional top-post or contextless message?

    Steve
    http://www.fivetrees.com
     
  18. CBFalconer

    CBFalconer Guest

    You haven't been listening. I do use a threaded reader. Things
    are threaded. Contextless messages are a plague.

    My offhand guesstimate is that about 50% of the clueless
    googlemeisters eventually become clued, and behave appropriately.
    Without attempts to educate them that percentage would be zero. At
    the same time I would guess that less than 5% of accurate answers
    to problems come from uneducated google users (those that don't
    supply context). So there are basically two choices - abandon the
    newsgroups to the raving idiots, or inform them. The more users
    who choose inform the sooner the job is done (on that particular
    googler). There will always be more until google reforms and stops
    doing evil to usenet.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    More details at: <http://cfaj.freeshell.org/google/>
    Also see <http://www.safalra.com/special/googlegroupsreply/>
     
  19. Pooh Bear

    Pooh Bear Guest

    I have indeed written my own procedures for handling I2C. Maybe not the
    cleverest but they work day in day out.

    Graham
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-