last day (47 days later) » 

8:13 AM
0
A: THM3060 RFID reader setup issues

tlfong01Question How to set up the THM3060 RFID reader? The OP's RFID module wiring is show below. Answer Contents Part A - Schematic Part B - User Manual Reading Notes Part C - Pi My Life Up Library Testing Notes Part A - Schematic Introduction The AliExpress product sheet says the OP's RFID module i...

 
Hi and thank you for the detailed answer. Firstly I will clarify a few of your questions. I am experienced with arduinos and raspberry pi, although it is the first time I need to use SPI communication. Secondly, Im not a tight schedule but I would like to pin down the source of the problem as quickly as possible. Currently the project is a bit of a pilot, and future developments are based on the success of its proper functioning.
Regarding the 5V power supply concerns. I was confident in the 5V supply due to the product description on aliexpress, as well as the two voltage regulators on the board. I did initially try the system with 3.3V supply but with no success. I will definitely try the SPI loop test you suggested. Regarding your setup, which pin should I connect the SPI CS0 to, on my board? Thanks in advance!
 
Ah, thank you for your reply. Now 4 quick suggestions. (1) Read Part C of my answer and do the CLI SPI loopback test. It is important to first make sure the SPI wiring is OK, (2) Then again use CLI to test SimpleMFRC522. If you have difficulty using CLI commands, I can try to find old python to test in Thonny IDE. (3) I would suggest to power your RIFD moudle with 3V3, that is what I did last time. (4) I was playing with both RC522 and PN532, using UART, SPI, and I2C at the same time, and I forgot which module is using which, so I might have mixed up things. So compare my screen captures.
 
What do i connect the SPI CS0 pin to on my board? I dont seem to have any more SPI related pins (as shown on the second image)
 
Ah, thank you for clarification and confirmation on the 5V power supply. So I quickly conclude the the user guide V1.1 (which says 3V3 ~ 3V6 is optimum) or something is out of date, because they have V1.2 or V1.3 (Note 1), I forgot. Just now I looked at my RC522 module and did not find any 3 pin 5V to 3V3 regulator, so I always use 3V3 for testing. As the old smart guy Warren Buffett says: There "aren't just one cockroach in the kitchen“. So should expect more misinformation. Already mentioned that their chip is NOT 522 but might not be 100% compatible chip.
About the CS pin, because they are using the same board with UART, I2C and SPI, so they are using one or two pins for more than one function. Let me check and report back.
 
Also, is the SPI loopback test conducted with the reader connected to the raspberry, or is it only connecting the MISO pin of the raspberry to the MOSI pin of the raspberry directly?
 
8:13 AM
You might like to look at my photo above. My SPI colour coding is this: CLK = purple, MOSI = orange, MISO = yellow (some time might be swapped). But CS0 should be GREEN in the picture (sometimes I also use blue, brown, grey etc for more CSn, but green is 99% sure the CS pin.) I remember there are two versions of RS522 boards, so you need to look at the labeling at the reverse time of the PCB.
Ah, yes, when testing SPI loopback, you put the RFID module aside and just test this loopback thing. Procedure (1) connect/short MOSI to MISO, then do the test. (2) There is a slight complication. SPI loopback only makes sure MOSI writing out can be read back by MISO, *** CS pin is NOT tested.***. So you need to use a python program to read the module's register (sort of pinging) to make sure CS0 is also working. Another thing is that you should not use wiring of longer than 30~60cm, the shorter the better,
Also you might like to lower SPI speed to 100k, 50k or even 10kHz, just for testing.
Too many comments messed up this space, let us go to the chat room.
Are you there?
 
Hi
I understand the loopback test. I will manage with that. But I still dont understand what you mean by the CS0 pin
Based on my pinout diagram I dont have a CS0 or any other CS related pins whatsoever
Also, you mentioned that I should try out the rfid reader test using CLI commands. Is there a difference between using CLI commands or just calling a script? I basically have the exact same lines of code in my script and that didnt make the reader read
 
8:38 AM
(1) Good that you understand the SPI loopback test, (2) CS0 pin is the SPI Chip Select pin for SPI port 0.0. (3) CS0 is the chip select pin for SPI port 0.1. (4) Ah, if you know bush scripts of course it is better than typing terminal commands one by one. (5) You board seems to have a 9 pin connector, but me only 8. I always miss/lose count, you better compare the pictures.
So you can import the library OK, reader.write('123') returns no errors, but reader.read() returns not the same thing '123'?
(6) And if SPI loopback test OK?
 
8:55 AM
You might like to read Reference 7 of my answer to find a program to do two things: (1) SPI loopback, (2) MCP3021 ADC testing. You might like to see if you can use the program is do loop back (Never mind the MCP3201 part, which is not irrelevant to your project.) The program is workable, and just plug and play, no library is required.
 
Yes my board has 9 pins, which was also odd for me. Basically the process is as follows;
1-I do the wiring
2-I execute the write script
3-The script runs, no error codes come up, but It does not write onto the chip. I know this, because the script itself contains error checking. So if the write process was successful, the script would continue and print a confirmation message. But that doesnt happen.
 
Ah, time for jogging and eating. So see you late this evening or tomorrow. Good luck and cheers.
 
If I execute the read script, then I also get hung up on the read procedure. The device is waiting to read the chip details, but it doesnt sense the chip. Again, error checking in the script confirmed this.
My wire lengths are not an issue. I use quite short wires, and I also had that issue in the past so i specifically take care of that on all my projects. One more thing I can imagine is that perhaps the manufacturer used lower capacitors than indicated in the design document, which could lead to a brown-out on the reader side. I also had this issue in the past on other projects.

Enjoy the run. Speak to you later
 
I see. I am glad to know that you have lots of troubleshooting experience and also fluent in bush scripts. So if you are going a play with python SPI project, there are no harm doing the basic SPI loopback tests. By the way, my test program consists of two python programs (1) SPI utility, (2) MCP3201 ADC tests, which imports SPI utility.
The SPI utility can run and test loopback by itself, and has newbie friendly sample outputs. It would be nice if you can try it and let me know it is user friendly and any thing to improve. See you later.
 
9:15 AM
Where do i find your test program?
 
 
2 hours later…
11:40 AM
Ah, I wrote too fast: tlfong01 3872 16:55
You might like to read ***Reference 7 of my answer*** to find a program to do two things: (1) SPI loopback, (2) MCP3021 ADC testing. You might like to see if you can use the program is do loop back (Never mind the MCP3201 part, which is not irrelevant to your project.) The program is workable, and just plug and play, no library is required.
 
 
9 hours later…
9:05 PM
I will give it a try. I have also received the documentation from the manufacturer. Im beginning to think that the issue might be software related
 

  last day (47 days later) »