I2C Lock-up. i2c_t3 questions.

Status
Not open for further replies.

Cosford

Well-known member
Hi,

Trying to rig up an RC522 RFID reader to the I2C bus for communications according to this pinout:
http://4.bp.blogspot.com/-CypWJHefOgY/U9AnzSpeEyI/AAAAAAAABao/fZKUC4YPNRk/s1600/RFID-RC522-pinout.png

Using 4.7k pullups on both SCL and SDA lines.

Now, when running the i2c_t3 scanner sketch, (modified to remove the calls to external hardware, so it just always checks for both acks and nacks), it hangs during the call to Wire.endTransmission(), requiring a power cycle to bring it back up again.

In addition, I found removing the RC522 reader from the i2c bus (so that there is nothing connected to the bus except the pullups) also yields the same issue?
Is this normal? That having nothing on the bus would cause Wire.endTransmission() to hang?

Regards,
Cosford.
 
I just debugged the same issue.

I just debugged the same issue for another new user. I'm gonna ask the developer to fix the example because it makes it newbie unfriendly to hang like this. I added the following command to the setup() to fix.

void setup()
{
pinMode(LED_BUILTIN,OUTPUT); // LED
pinMode(12,INPUT_PULLUP); // Control for Test1
pinMode(11,INPUT_PULLUP); // Control for Test2

Serial.begin(115200);

// Setup for Master mode, pins 18/19, external pullups, 400kHz
Wire.begin(I2C_MASTER, 0x00, I2C_PINS_18_19, I2C_PULLUP_EXT, I2C_RATE_400);

Wire.setDefaultTimeout ( 100000 );
}
 
Great thanks, will give it a shot today.
I'd given up with the intention of using the SPI interface for the RC522 but if I can still get it running on i2c that would be preferred.
 
Gave it a go with Wire.setDefaultTimeout (at least, after I'd updated the library), and that prevents it from hanging. Thanks for that.

For anyone finding this through google, I looked into the datasheet a little more for the RC522 chip and it seems that to select the interface to communicate with the chip, you need to present particular hardware configurations upon coming out of Reset. Unfortunately, the hardware setup for I2c requires bringing the I2c pin (pin 1 of the RC522) to logic high; which is near impossible to do on this board as pin 1 doesn't seem to be brought out to anywhere and the pin itself is too small to solder to directly.
 
Status
Not open for further replies.
Back
Top