Loading ...
Sorry, an error occurred while loading the content.
 

I2C device driver?

Expand Messages
  • Harald Kubota
    Hi, A simple and quick question: For the eZ80 I find a complete looking i2c function set, for ARM I cannot find it. I guess there is none, and I d have to
    Message 1 of 7 , Jun 3, 2009
      Hi,

      A simple and quick question:
      For the eZ80 I find a complete looking i2c function set, for ARM I
      cannot find it.

      I guess there is none, and I'd have to program that myself, right?
      There are enough examples (for LPC214x), so that should not be too big
      of a problem.

      Harald
    • Gregory Nutt
      Hi, Harald, The email is VERY slow today! I m not sure if any email have been delivered since this morning. ... No, there is no I2C driver for the LPC2148.
      Message 2 of 7 , Jun 3, 2009
        Hi, Harald,

        The email is VERY slow today! I'm not sure if any email have been delivered since this morning.

        You wrote:
        > Hi,
        >
        > A simple and quick question:
        > For the eZ80 I find a complete looking i2c function set, for ARM I
        > cannot find it.
        >
        > I guess there is none, and I'd have to program that myself, right?
        > There are enough examples (for LPC214x), so that should not be too big
        > of a problem.
        >
        > Harald

        No, there is no I2C driver for the LPC2148. The driver should be really easy to write (as you say, there are lots of examples around). The trick is testing it -- you have to have some I2C devices in order to test. If you get a working I2C driver for the LPC2148, I'd love to incorporate it into NuttX if you are willing to contribute it.

        I am trying to use a simple, consistent architecture for I2C drivers so that they can be reused on many devices. For example, NuttX could have one EEPROM driver that interfaces through a variety of different I2C drivers. I don't do anything complex (like Linux with the I2C busses, platform drivers, platform devices, etc). But I do try to be consistent with the interfaces.

        There is some description of the I2C interfaces here: http://nuttx.sourceforge.net/NuttxPortingGuide.html#i2cdrivers
        I could also put together an (untested) I2C driver if that would be helpful to you.

        Greg
      • hkubota@gmx.net
        ... That is no problem. I`ll attempt to write a i2c driver and see how that works out. This will take until end of June though as I am covered in work. Once I
        Message 3 of 7 , Jun 4, 2009
          > The trick is testing it -- you have to have some I2C devices in order to test.

          That is no problem. I`ll attempt to write a i2c driver and see how that works out. This will take until end of June though as I am covered in work. Once I have something, I`ll rend it to you to make sure I don`t break any NuttX coding rules.

          Harald
        • Gregory Nutt
          I did add an I2C header file: http://nuttx.cvs.sourceforge.net/viewvc/*checkout*/nuttx/nuttx/arch/arm/src/lpc214x/lpc214x_i2c.h?revision=1.1
          Message 4 of 7 , Jun 4, 2009
          • Harald Kubota
            ... Sure puts me under pressure now ;-) But it s a time saver. Thanks for that. Harald
            Message 5 of 7 , Jun 5, 2009
              Gregory Nutt wrote:
              > I did add an I2C header file: http://nuttx.cvs.sourceforge.net/viewvc/*checkout*/nuttx/nuttx/arch/arm/src/lpc214x/lpc214x_i2c.h?revision=1.1
              >

              Sure puts me under pressure now

              ;-)

              But it's a time saver. Thanks for that.

              Harald
            • Harald Kubota
              ... Turns out my coding skills are not good enough when it comes to interrupt drivers and my time available for programming is shorter than expected. In short:
              Message 6 of 7 , Jun 27, 2009
                hkubota@... wrote:
                >> The trick is testing it -- you have to have some I2C devices in order to test.
                >>
                >
                > That is no problem. I`ll attempt to write a i2c driver and see how that works out. This will take until end of June though as I am covered in work.

                Turns out my coding skills are not good enough when it comes to
                interrupt drivers and my time available for programming is shorter than
                expected.
                In short: it did not work. Having a DSO would be needed if only to
                verify nothing gets out of the I2C pins. The LEDs I connected to an
                PCF8574A did not light up. Which means something is not working, but I
                have no easy way to find out what it is.

                When I whipped out my Propeller board which was sitting on my shelf for
                about half a year without being used, that in turn worked within an
                hour, mostly because there was already a driver for I2C. Which of course
                even lowered my will to make the NuttX I2C driver work.

                So if anyone is waiting for an LPC214x driver: don't wait for me. I wish
                I had time for this. I certainly prefer programming in C than in SPIN
                (which the Propeller uses normally), but I'll have to wait until someone
                provides the driver for LPC214x.

                Harald
              • Gregory Nutt
                ... On Monday, I start some new contract work and will not have much free time either for awhile (that is why I rushed 0.4.9 out yesterday -- probably a little
                Message 7 of 7 , Jun 27, 2009
                  --- In nuttx@yahoogroups.com, Harald Kubota <hkubota@...> wrote:
                  > So if anyone is waiting for an LPC214x driver: don't wait for me. I wish
                  > I had time for this. ...

                  On Monday, I start some new contract work and will not have much free time either for awhile (that is why I rushed 0.4.9 out yesterday -- probably a little too early. It really needed more testing).

                  But if you want to email your I2C driver to me, I can (1) desk check it very carefully to see if I can see any problems, and (2) incorporate it into the NuttX source tree (with a warning that it is untested). It would need to have a BSD license for that. Perhaps then some one else will pick it up and get it working in the future.

                  Greg
                Your message has been successfully submitted and would be delivered to recipients shortly.