Fattoresaimon / I2CEncoderMini

GNU General Public License v3.0
32 stars 7 forks source link

Mini Encoder not found. #3

Closed psy1261 closed 4 years ago

psy1261 commented 4 years ago

I bought several of the mini boards a few months ago but just now got to try them out. I am running the Change_Address program but can never find the encoder. I have tried three diffrent boards using a Tinsey 3.2, NodeMCU v2 ESP8266 and a ATmega328P. I have verified my setup each time using an MCP23017 wired for address 0x27, the MCP chip always shows up but never the mini. Any thoughts or suggestions?

Fattoresaimon commented 4 years ago

Hello, Did you checked the if there are the pull-up resistors on the I2C bus? With the default address it works? Thank you!

psy1261 commented 4 years ago

Yes, as I said I confirmed via two other devices. My apologies, what is the default address? 0x20?

I used 10K pull-up resisters to connect +5v to SCL and +5v to SDA.

I used three diffrent sketches to find i2c devices all three found the other two devices but never the mini encoder. I also ran the Change_Address sketch but it never finds the min-encoder. I am lost.

Paul

On Oct 16, 2020, at 3:06 PM, FattoreSaimon notifications@github.com wrote:

Hello, Did you checked the if there are the pull-up resistors on the I2C bus? With the default address it works? Thank you!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Fattoresaimon/I2CEncoderMini/issues/3#issuecomment-710534712, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWUD4EIT66TCLRFMJPOKLDSLCRTVANCNFSM4STTLIZA.

Fattoresaimon commented 4 years ago

yes the default address is 0x20 But if the other devices are found the problem are not the pull-up resistors. check the connection please, and send me a email with the order number.

psy1261 commented 4 years ago

I installed the header pins and hooked up one of the other i2c devices… the two devices are still registering but the mini encoder is not.

Order number was 203512 on July 11 2020.

Any other troubleshooting steps? Any advantage to changing wire speed? Using the internal pull-ups instead of external? These mini boards would solve several problems I am facing if I can get them to work.

Paul

On Oct 16, 2020, at 3:19 PM, FattoreSaimon notifications@github.com wrote:

yes the default address is 0x20 But if the other devices are found the problem are not the pull-up resistors. check the connection please, and send me a email with the order number.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Fattoresaimon/I2CEncoderMini/issues/3#issuecomment-710556777, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWUD4EB76WM37CYGUKTJMDSLCTG5ANCNFSM4STTLIZA.

Fattoresaimon commented 4 years ago

Hello, Did you tried alle the boards that you bought? Did you tried the example project? Did you verified if there is an address conflict in the i2c bus

Try only one board alone without the other device in the same i2c bus.

psy1261 commented 4 years ago

Howdy

I setup an ATmega328P with an Ardweeny programing backpack, external 10K pull-up resisters and only the mini encoder board. I did make one small change to your Change_Address.ino sketch:

void Search(void) { uint8_t i, error; Serial.println("Scanning...."); for (i = 0; i < 0x80; i++ ) { Wire.beginTransmission(i); error = Wire.endTransmission();

if (error == 0)    {
  Encoder.address = i;
 // if (Encoder.readIDCode() == 0x39) {             // Comment out his line
    Serial.print("I2C Encoder mini found at ");
    Serial.print(Encoder.address);
    Serial.print(" ( ");
    PrintHEX(Encoder.address);
    Serial.print(" )");
    Serial.println(" !!");
  //}                                           // Comment out his line
}

} }

This allowed be to substitute and i2c OLED display to make sure I have the hardware setup correctly. With the above change I got the following printout: I2C Encoder Address changer! All the devices must have different address! Avaiable commands: S: for searching the I2C encoder mini 0xXX or XXX: Address of the target device in hex or decimal

Scanning.... I2C Encoder mini found at 60 ( 0x3C ) !! <<<< Correctly identifies the i2c OLED display.

At this point, I soldered headers on all the remaining bards. To test I put each new board in circuit, presed the rest button on the Ardweeny/ATmega328P and then entered “S” on the program. I left in the two comments above int the code. I tested all boards with the same results, the mini encoders were not found. I have to be missing something.

On Oct 17, 2020, at 8:42 AM, FattoreSaimon notifications@github.com wrote:

Hello, Did you tried alle the boards that you bought? Did you tried the example project? Did you verified if there is an address conflict in the i2c bus

Try only one board alone without the other device in the same i2c bus.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Fattoresaimon/I2CEncoderMini/issues/3#issuecomment-710974407, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWUD4GBA6L25OPFDILLZ7LSLGNL3ANCNFSM4STTLIZA.

psy1261 commented 4 years ago

Well I feel stupid.

I thought the pinout was SCL SDA Open Pin + - Im fact it is NT SCL SDA + -

It works now. What in the NT pin for?

On Oct 17, 2020, at 8:42 AM, FattoreSaimon notifications@github.com wrote:

Hello, Did you tried alle the boards that you bought? Did you tried the example project? Did you verified if there is an address conflict in the i2c bus

Try only one board alone without the other device in the same i2c bus.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Fattoresaimon/I2CEncoderMini/issues/3#issuecomment-710974407, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWUD4GBA6L25OPFDILLZ7LSLGNL3ANCNFSM4STTLIZA.

Fattoresaimon commented 4 years ago

😆 Good that you made to work! Well there is no NT pin, it's the INT pin. It's the interrupt output pin, it used to sense when the encoder is rotated without continually pooling the board. Please check out the datasheet: https://github.com/Fattoresaimon/I2CEncoderMini/blob/master/I2CEncoderMini_v1.2.pdf

psy1261 commented 4 years ago

All working as expected! Thank you for all the help!!!