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

Re: I2C 1 on ADuC7020

Expand Messages
  • Andrey
    Ok, I have added this to my IRQ handler: if( I2C1MSTA & (1
    Message 1 of 6 , Oct 16, 2006
    • 0 Attachment
      Ok, I have added this to my IRQ handler:

      if( I2C1MSTA & (1<<UNDERLOW) )
      { /* workaround for I2C problem */
      uart_puts( "doing I2C workaround\n" );
      I2C1ADR= 0x42;
      I2C1MTX = 0x12; /* write junk data */
      I2C1MSTA |= (1<<FLUSH); /* and flush the FIFO */
      }

      So now I am catching the one interrupt I get (FIFO underflow). As I
      understand their note, I put some data in the transmit FIFO and then
      FLUSH the FIFO. That doesn't seem to solve my problem thus far. I've
      double-checked my wiring (well, all four wires...) and I've tried
      different pull up resistors (1K and 10K) and no luck thus far.

      Am I understanding/implementing their workaround correctly? Any other
      suggestions? Thanks!

      -Andrey
    • good_roots_in_germany
      The timing on the I2C bus is very critical. If you do an UART trace than you already too late. Also if you run it in IRQ through a dispatcher. I implemented it
      Message 2 of 6 , Nov 22, 2006
      • 0 Attachment
        The timing on the I2C bus is very critical. If you do an UART trace
        than you already too late. Also if you run it in IRQ through a
        dispatcher.
        I implemented it as a plain code without IRQ. You can find my library
        with a test program under "files" in this group. It works!
        All the best
        Guenther

        --- In ADuC_ARM@yahoogroups.com, "Andrey" <yurovsky@...> wrote:
        >
        > Ok, I have added this to my IRQ handler:
        >
        > if( I2C1MSTA & (1<<UNDERLOW) )
        > { /* workaround for I2C problem */
        > uart_puts( "doing I2C workaround\n" );
        > I2C1ADR= 0x42;
        > I2C1MTX = 0x12; /* write junk data */
        > I2C1MSTA |= (1<<FLUSH); /* and flush the FIFO */
        > }
        >
        > So now I am catching the one interrupt I get (FIFO underflow). As I
        > understand their note, I put some data in the transmit FIFO and then
        > FLUSH the FIFO. That doesn't seem to solve my problem thus far.
        I've
        > double-checked my wiring (well, all four wires...) and I've tried
        > different pull up resistors (1K and 10K) and no luck thus far.
        >
        > Am I understanding/implementing their workaround correctly? Any
        other
        > suggestions? Thanks!
        >
        > -Andrey
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.