THM3060 RFID - SPI Communication Issues

Hi,

I have been trying to establish communication with a THM3060 rfid reader and an Arduino Nano. Im using the SPI library but I can not read/write to any of the device registers. According to the documentation the device uses MSBFIRST and MODE0 settings. I have tested various clock speeds from as low as 10kHz up to 4MHz but with no difference.

I have tried the system with 5V, as well as 3.3V. The datasheet recommends 3.3V but the reader circuitry has additional components, which require the input voltage to be 5V (according to the manufacturer). Keep in mind no additional datasheet was available other than the one attached.

Im trying to figure out if the problem is on the software side or the hardware side. The manufacturer has terrible support so I thought I would try this forum as well. I would appreciate any help, as I have been stuck on this for a week now. Thank you!

Here is my code;

#include <SPI.h>

#define SPI_SS     10   //reader pin 8--arduino nano pin D10

//  Create an SPISettings object
SPISettings settingsA(100000, MSBFIRST, SPI_MODE0);

void setup() {

  Serial.begin(9600);
  Serial.println("THM3060 RFID Chip Test\n");
  delay(2000);

  // Output pins
  pinMode(SPI_SS,OUTPUT);
  SPI.begin();
}

void loop() {

  //--------------------------  Read from register PSEL  BEFORE--------------------------
  
  byte result=0xFF;

  SPI.beginTransaction(settingsA);
  
  digitalWrite(SPI_SS,LOW);   // Start communication
  SPI.transfer(0x01);         //  Read from address
  result= SPI.transfer(0x00);
  digitalWrite(SPI_SS,HIGH);   // End communication

  SPI.endTransaction();

  Serial.println("READ PSEL before setting");
  Serial.println(result);
  delay(2000);

  //-------------------------------Write to register PSEL----------------
  
  Serial.println("Writing to PSEL");
  delay(2000);

  SPI.beginTransaction(settingsA);
  
  digitalWrite(SPI_SS,LOW);   // Start communication
  SPI.transfer(0x81);         //  Write to address
  SPI.transfer(0x20);         // Data
  digitalWrite(SPI_SS,HIGH);   // End communication

  SPI.endTransaction();


  //--------------------------  Read from register PSEL after --------------------------
  
  
  Serial.println("READ PSEL after setting");
  delay(2000);  

  SPI.beginTransaction(settingsA);
  
  digitalWrite(SPI_SS,LOW);   // Start communication
  SPI.transfer(0x01);         //  Read from address
  result= SPI.transfer(0x00);
  digitalWrite(SPI_SS,HIGH);   // End communication

  SPI.endTransaction();

  Serial.println(result);
  delay(2000);
}

THM3060_chip_document.pdf (518 KB)

thm3060_schematic.pdf (40.7 KB)

I'm missing a wiring diagram! If the breakout board includes additional components a schematics of this board is also needed.

I have added the breakout pinout and the schematic as well!

And how did you wire that to the Arduino?

This is the wiring I am using

#define SPI_SS 10 // reader pin 8--arduino nano pin D10- SPI SS OUTPUT for arduino
//#define SPI_CLK 13 // reader pin 3--arduino nano pin D13- SPI SCK OUTPUT for arduino
//#define SPI_MISO 12 // reader pin 4--arduino nano pin D12- SPI MISO INPUT for arduino
//#define SPI_MOSI 11 // reader pin 5--arduino nano pin D11- SPI MOSI OUTPUT for arduino
//#define STANDBY 9 // reader pin 7--arduino nano pin D09- simple digital pin OUTPUT for arduino
//#define RSTN 8 // reader pin 6--arduino nano pin D08- simple digital pin OUTPUT for arduino
//#define IRQ 7 // reader pin 9--arduino nano pin D07- simple digital pin INPUT for arduino

spitroubles:
This is the wiring I am using

#define SPI_SS 10 // reader pin 8--arduino nano pin D10- SPI SS OUTPUT for arduino
//#define SPI_CLK 13 // reader pin 3--arduino nano pin D13- SPI SCK OUTPUT for arduino
//#define SPI_MISO 12 // reader pin 4--arduino nano pin D12- SPI MISO INPUT for arduino
//#define SPI_MOSI 11 // reader pin 5--arduino nano pin D11- SPI MOSI OUTPUT for arduino
//#define STANDBY 9 // reader pin 7--arduino nano pin D09- simple digital pin OUTPUT for arduino
//#define RSTN 8 // reader pin 6--arduino nano pin D08- simple digital pin OUTPUT for arduino
//#define IRQ 7 // reader pin 9--arduino nano pin D07- simple digital pin INPUT for arduino

In this case you forgot to power the device. GND and DVDD must be connected too.

I have tried powering the device from the 5V output pin as well as the 3.3V pin. I missed that in my previous comment. The reader is powered from the 3.3V pin of the arduino

Setting 1
Arduino GND - - - Reader GND
Arduino 3.3V - - - Reader DVDD

Setting 2
Arduino GND - - - Reader GND
Arduino 5V - - - Reader DVDD

Neither one of these settings made it possible to read/write any of the registers

I have tried testing the reader with an LED in series with the power pin. It lights up for approximately 4 seconds then it goes out. I havent measured the current yet but it seems like the reader chip shuts down. Which would indicate power problems.

I also placed a 100uF capacitor between the power and the GND pins as close to the reader as i could. But this did not stop the shut down behaviour.

Im really stuck on this problem. Please help me out! I cant really verify if the capacitors are the correct values on the board as they are not labelled.

Any ideas? What else could i try?

The reader is powered from the 3.3V pin of the arduino

Power it only with the same voltage as the Arduino! Otherwise the signal pins get a higher voltage than the Vdd which might fry the chip.

pylon:
Power it only with the same voltage as the Arduino! Otherwise the signal pins get a higher voltage than the Vdd which might fry the chip.

Currently I have my nano connected to the computer through the USB port. Then I take the 3.3V pin to power the rfid reader. This allows me to use the serial monitor for checking data read/write.

Are you suggesting a separate power line to power both the nano (not the USB port, but the VIN pin), and the rfid reader module?

5V -- VIN (nano)
5V -- DVDD (reader)

and a common ground for both?

That would complicate things with the serial monitor though, would it not?

By the way I check the reader with the LED again and I realized that the MOSI pin causes the shut down. If thats not connected and I set the SPI_SS pin to low and leave it that way, then the system powers on fine and remains powered. I have also measured the MOSI voltage.

arduino nano connected to computer ---rfid reader connected to nano 3.3V pin---MOSI 4.8V
arduino nano connected to computer ---rfid reader connected to nano 5V pin---MOSI 4.8V

Edit:
I have dropped the MOSI and the SPI_SS pins to 3.45V (best I could do with resistors) and the power is now maintained when I turn the system on from 5V supply pin of the nano. The SPI_CLK pin only showed 3.9mV on its output. I dont know if thats correct or not for the clock signal

However, Im still unable to read/write anything to the registers.

Are you suggesting a separate power line to power both the nano (not the USB port, but the VIN pin), and the rfid reader module?

No, just connect the Vdd of the reader with the 5V pin of the Nano.

By the way I check the reader with the LED again and I realized that the MOSI pin causes the shut down. If thats not connected and I set the SPI_SS pin to low and leave it that way, then the system powers on fine and remains powered. I have also measured the MOSI voltage.

That's another hint that I might be right...

I have dropped the MOSI and the SPI_SS pins to 3.45V (best I could do with resistors) and the power is now maintained when I turn the system on from 5V supply pin of the nano. The SPI_CLK pin only showed 3.9mV on its output. I dont know if thats correct or not for the clock signal

If you power the RFID board with 5V you don't have these issues.

pylon:
No, just connect the Vdd of the reader with the 5V pin of the Nano.

That was one of the first things i did when i received the rfid readers. I was unable to read or write the registers that way. Thats why i turned to this forum in the first place.

I will try to test an unused device with a 3.3V level shifter, because im thinking that the chip itself is not 5V tolerant (regardless of the manufacturer claims) . In that case the MOSI pin or the SPI_SS pin could have fried the chip memory causing the register to not respond at all.

The other possible reason might be a crappy board design with a loose or questionable grounding circuitry.

I will leave an update once i have run the new tests