2023-06-28 02:09 AM - last edited on 2023-07-04 11:44 PM by Ulysses HERNIOSUS
Hi!
A while back I started writing Rust driver for st25r3911b chip. Currently, it works and can read 14443A chip. The issue is that compared to official software (Discovery GUI) the read distance is about half. So if official software reads at 8-9cm then with rust driver it would just 5-6 cm.
I feel like I have messed up some register configurations. My knowledge of RF is very limited. Could someone point me in the right direction of what I should look into?
https://github.com/xpresshd/st25r3911b/blob/master/src/lib.rs#L168
Thanks!
Solved! Go to Solution.
2023-07-07 06:33 AM
Found out the issue of 1. point about CS being low. Had race condition in CS logic. Fixed it and everything works well
For 2. point about reading all interrupts in one go I run into issue. Now chip crashes very often, tho it seems to be doing correct thing.
What confuses me is why Intr jumps back high when I start reading interrupt registers
Full capture https://drive.google.com/file/d/1SAemCfJw4mEV1qpmJcbMVyvOv9UK2beI/view?usp=sharing
2023-07-07 07:56 AM
Hi,
@RMuiz.1 wrote:What confuses me is why Intr jumps back high when I start reading interrupt registers
See § "Interrupt interface" in the ST25R3911B datasheet: [...]IRQ pin transitions to low after the interrupt bit(s) that caused its transition to high has (have) been read.
It is likely that a second interrupt is signalled while reading the second interrutp register (likely I_rxe interrupt).
Make sure to configure the Salae SPI decoder with CPOL=0 and CPHA=1 to properly decode the SPI frames. The SPI CS handling seems to be erroneous (except if another devices are connected to the SPI bus):
The SPI clock seems to be quite low (300 kHz). Our demos use a SPI clock = 3Mbps.
Rgds
BT