Author Topic: DigiX not finding I2C decives or reading RX/TX  (Read 11026 times)

jaja543

  • Newbie
  • *
  • Posts: 7
DigiX not finding I2C decives or reading RX/TX
« on: May 16, 2014, 05:25:13 pm »
I think i may have broken my DigiX, a I2C port scanner is seeing nothing, directly addressing them does nothing.  I also can't read my GPS on any Digital pins or the RX/TX pins.  Is there a way i can verify that I've damaged the hardware or are my programming skills that bad?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #1 on: May 16, 2014, 05:47:32 pm »
Does the wifi module work? That is serial.

Can you access the EEPROM (see digix eeprom example) - that is on I2C.

Those would be the two best tests I can think of

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #2 on: May 16, 2014, 05:55:24 pm »
Have you gotten it to work at all before with the scanner or gps?   Do you have another arduino to try with?   Do you have any other  i2c devices to try?  Can you test the pins involved to read or write digitally and work both ways?

Double check you are on the right pins and that they work as expected wired to other pins.   If that doesn't work then something may indeed be broken. 
« Last Edit: May 16, 2014, 11:51:10 pm by defragster »

tastewar

  • Jr. Member
  • **
  • Posts: 50
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #3 on: May 17, 2014, 12:19:43 pm »
Also try something really simple like the blink sketch. Are you able to program it via arduino?

jaja543

  • Newbie
  • *
  • Posts: 7
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #4 on: May 19, 2014, 07:57:38 am »
So I tried the EEPROM example, and get nothing, Wifi seems to be working, did the basic web server.  Analog and digital Read are fine.  Pin wiring seems to be fine.  Any other ideas?

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #5 on: May 19, 2014, 08:58:28 am »
Is there anything connected to the DigiX I2C-pins, when trying the EEPROM-example?
If so, retry without any external components, as the pullups for the I2C bus are on board.

If the EEPROM-example is not working with the bare DigiX, you may have killed something.


jaja543

  • Newbie
  • *
  • Posts: 7
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #6 on: May 19, 2014, 11:22:31 am »
Nope, there is nothing connected to the I2C pins.  The EEPROM sketch just gives me a blank serial screen.

jaja543

  • Newbie
  • *
  • Posts: 7
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #7 on: May 21, 2014, 05:14:47 am »
So i ran the EEPROM test from "EEPROM clearing between resets" and that seemed to give back the correct read/writes.  I am still unable to use my  I2C LCD and can't even get my rx/tx working correctly with a blank sketch.

kd7eir

  • Newbie
  • *
  • Posts: 17
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #8 on: May 21, 2014, 10:41:45 am »
I believe in eliminating everything possible - do you have another board to test the I2C LCD with? 

jaja543

  • Newbie
  • *
  • Posts: 7
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #9 on: May 21, 2014, 11:13:56 am »
Yes , everything working fine on my Uno.  Is it worth sending it in for a RMA or just cheaper to buy a new one?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #10 on: May 21, 2014, 11:45:26 am »
If it is a defective we will replace it - but one question about the i2c LCD - is it a 5v LCD? or a 3.3v? Is 5v or 3.3v being applied to the VCC pin on the LCD and is a level shifter being used?

jaja543

  • Newbie
  • *
  • Posts: 7
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #11 on: May 21, 2014, 12:35:06 pm »
It is the I2C LCD for the DigiSpark, and yes i'll admit i hooked it up the the 5V power supply too at one point with not level shifter.  Did I burn out the pins and also also caused my RX/TX issues?

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #12 on: May 22, 2014, 12:33:40 am »
In that case I strongly assume, that you have killed parts of your chip! :-(

@Digistump:  I pulled the 5V-warning in the Wiki (http://digistump.com/wiki/digix/overview) from the footer to the header and marked it bold here: http://digistump.com/wiki/digix/digix


gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #13 on: May 22, 2014, 03:55:04 am »
You can test your serial ports with the following script:

crossconnect always two serial ports TX<->RX and watch the output over SerialUSB!

Code: [Select]
/* ###################################################################################
   #  Simple Demo program to test two serial ports of the DigiX / Arduino DUE        #
   #  with parallel threads using the scheduler-library                              #
   #  crossconnect pin 14 (TX3) with pin 17 (RX2)                                    #
   #               pin 15 (RX3) with pin 16 (TX2)                                    #
   #  if you connect other serial ports, change the code as well                     #
   ################################################################################### */

#include <Scheduler.h>

void setup() {
  Serial2.begin(57600);
  Serial3.begin(57600);
  SerialUSB.begin(57600);
  while(!SerialUSB.available()){
    SerialUSB.println("Enter any key to begin");
    delay(1000);
  }
  Scheduler.startLoop(loop2);
}

void loop() {
  char inChar;
  yield();  /* give other loops a chance to run */
  if (Serial3.available() > 0) {
    SerialUSB.print("Reading from Serial3: ");
    while ( Serial3.available() > 0) {
      inChar = Serial3.read();
      SerialUSB.print(inChar);
    }
  } 
}

void loop2() {
  Serial2.println("Lorem ipsum dolor sit amet");
  delay(1000); /* implies yield() */
}


jaja543

  • Newbie
  • *
  • Posts: 7
Re: DigiX not finding I2C decives or reading RX/TX
« Reply #14 on: May 22, 2014, 12:09:30 pm »
Ok well the RX/TX code worked, my inexperience is showing itself.  Now on to the I2C,  the example in the libraries works for write and read, but my I2C scanner is not seeing anything.  See code from arduino.cc below:

Code: [Select]
#include <Wire.h>


void setup()
{
  Wire.begin();

  Serial.begin(9600);
  Serial.println("\nI2C Scanner");
}


void loop()
{
  byte error, address;
  int nDevices;

  Serial.println("Scanning...");

  nDevices = 0;
  for(address = 1; address < 127; address++ )
  {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0)
    {
      Serial.print("I2C device found at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.print(address,HEX);
      Serial.println("  !");

      nDevices++;
    }
    else if (error==4)
    {
      Serial.print("Unknow error at address 0x");
      if (address<16)
        Serial.print("0");
      Serial.println(address,HEX);
    }   
  }
  if (nDevices == 0)
    Serial.println("No I2C devices found\n");
  else
    Serial.println("done\n");

  delay(5000);           // wait 5 seconds for next scan
}