Data corruption?

Hello,

I have a SparkFun Qwiic RFID breakout board (with ID-12LA reader) attached to an ESP32 ‘Feather’ board from Adafruit.

It runs an Arduino sketch that simply takes the tag information and sends it as keyboard input to the computer it’s attached to.

95% of the time, this works as intended. However, there is glitch that happens when a tad is scanned but the Arduino will send “-1-1-1-1-1-1-1” to the computer, over and over again. Sometimes this stops and the tag number is submitted, but often I have to unplug the device from the computer.

I have tried different things with the code, like slowing things down with delays, and removing the “print.serial” instruction… but this glitch still happens.

Here is the code running on the arduino board:

#include <Wire.h>
#include "Keyboard.h"
#include "SparkFun_Qwiic_Rfid.h"

#define RFID_ADDR 0x7D // Default I2C address 

// Interrupt Pin on pin 5.
const int intPin = 5;
String tag;
int ledPIN = 13;

Qwiic_Rfid myRfid(RFID_ADDR);


void setup()
{
  pinMode(ledPIN, OUTPUT);

  // Begin I-squared-C
  Wire.begin();
  //Serial.begin(50000);

  if (myRfid.begin())
    Serial.println("Ready to scan some tags!");
  else
    Serial.println("Could not communicate with the Qwiic RFID Reader!!!");

  // Put the interrupt pin in a known HIGH state.
  pinMode(intPin, INPUT_PULLUP);

  // Want to clear tags sitting on the Qwiic RFID card?
  Keyboard.begin();

}

    void loop()
    {
        
      digitalWrite(ledPIN, HIGH);
      // If the pin goes low, then a card has been scanned.
      if (digitalRead(intPin) == LOW) {
        tag = myRfid.getTag();
        delay(50);
        //Serial.println(tag);
        Keyboard.println(tag);
        delay(50);
        Keyboard.press(KEY_LEFT_CTRL);
        delay(50);
        Keyboard.press('a');
        Keyboard.releaseAll();
        Keyboard.end();
        digitalWrite(ledPIN, LOW);
        
      }   
      delay(1000); // Geeze, woah! Slow it down mate.

    
    }

4/5 times this is due to the pull-up resistance becoming too high on the i2c lines

Scroll up just barely from here https://learn.sparkfun.com/tutorials/sp … e-assembly and remove the antenna, cut the i2c traces, and re-try…does the issue stop?

When I tried this, the reader’s light blinked as if it read a tag, but it took about 10 seconds for anything to show up, and when it did, it was “-1-1-1-1-1-1” repeatedly.

And I am pretty sure I damaged the i2c traces to the point where I can’t add bridge the pads with solder…so that’s not great.

If I used a Qwiic wire to connect to the board, I still have an issue with the i2c traces being cut, correct?

Correct…but it’s pretty hard to damage beyond use (unless the whole pads are ripped off…even then you can still wire in a resistor and use the PTH’s SDA/SCL)

Share a photo of what it looks like and we’ll go from there

you can still wire in a resistor and use the PTH’s SDA/SCL

Ok yes, how could I do this?

I would resolder the pin headers; those connections don’t look like the solder properly flowed from the pin to the pad

/mike

Ok, I will give it a shot.

I am still curious about “wire in a resistor and use the PTH’s SDA/SCL”. Can you explain that one a bit more?

What I’m referring to: Instead of using an on-board resistor, you can just wire a comparable resistor to the alternate pins…usually you need to snip the legs off the IC and solder the resistor between the header’s pad and the snipped legs

https://cdn.sparkfun.com/assets/5/f/e/b … LA-Sch.pdf you’d be replacing the R4 & R5 2.2k resistors here

Not seeing any interrupt routines in your code.

For external i2c pull-ups, connect a 5 to 10k resistor to sda and scl with the other ends of the resistors connected to 3.3 volts.

So I gave that a shot, and while the board’s pwr LED turns on, and the Read LED turns blue when a tag is close, I am not getting the tag number.

Just to be clear, the resistor is between the leg of the ATTINY84, and to the SDA and SCL pins ?

Or was the resistor being connected to the pad the IC leg was connecting to?

I know it’s not the best soldering job, but I had a close look and there’s no extra connections being made.


Thanks!

The resistors should be wired as pull-ups. Take one resistor, connect one end to the SDA header pin. Take the other end and connect it to the 3V3 header pin.

Take the second resistor, connect one end to SCL, and the other end to 3V3

/mike