cancel
Showing results for 
Search instead for 
Did you mean: 

Wakeup by tag detection

suads
Associate III

Hello,

I have a custom board with st25r95, I can read a tag and set it to sleep mode.

But I wan't Wakeup by tag detection and Interrupt on the Irq_out pin, so I'm sending the following command using the st25r95Idle(0x64, 0x74, 0x3f) function.

>>>0x07 0E 02 21 00 79 01 18 00 20 60 60 64 74 3F 08

and checking the Irq_out pin with a oscilloscope when a tag is placed! But nothing is happening!

1 ACCEPTED SOLUTION

Accepted Solutions
Brian TIDAL
ST Employee

Hi,

what is the DAC reference value returned by st25r95CalibrateTagDetector() in open field (without a tag in the field)? if it is still around 8, I believe there is a issue in the antenna or matching circuit. Have you checked  AN5248 (ST25R95 transceiver antenna tuning circuit with EMI filter)?

Note: The recommended value for the DAC guard (gRFAL.wum.cfg.indAmp.delta) is 2 DAC steps (i.e. 8 not 4).

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

10 REPLIES 10
Brian TIDAL
ST Employee

Hi,

The RFAL library performs a st25r95CalibrateTagDetector() during rfalInitialize(). As you seem to use directly the st25r95xxxx API, have you calibrated the DAC reference value thanks to st25r95CalibrateTagDetector? make sure to run the calibration in open field (i.e. without a tag in th RF field).

The content of the Idle command in st25r95xxxx API is

07 0E 0A 21 00 38 01 18 00 XX 60 60 XX XX 3F 00 which is different from the one you have mentioned:

07 0E 02 21 00 79 01 18 00 20 60 60 64 74 3F 08

Have you modified the original code?

if you have an X-NUCLEO_NFC03A1, can you check that your tag is properly causing a wake up with the original X-CUBE-NFC3 firmware?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
suads
Associate III

Hi, Brian

Yes I'm calling rfalAnalogConfigInitialize() and rfalInitialize() at the beginning then I try to send the st25r95Idle(0x64, 0x74, 0x3f); command. I'm not sure if this is the correct way? Yes I changed the code, I tried to edit the Idle buffer from st25r95_com_spi.c, tried with different commands. I'm reading the datasheet and going through the library.

Brian TIDAL
ST Employee

Hi,

make sure to use the ST25R95 Datasheet rather than the CR95HF datasheet as some typos have been fixed.

07 0E 0A 21 00 38 01 18 00 XX 60 60 XX XX 3F 00 

07 0E 02 21 00 79 01 18 00 20 60 60 64 74 3F 08

The API uses WakeUp source = 0A so that we can return in Ready mode after sending a IRQ_IN

The WU Control should be 38 01 as per the datasheet whereas 7901 seems to come from an older datasheet

MaxSleep is only used in case of wakeup on timeout, so it can be kept to 0 here as Wakeup on timeout is not used.

Is st25r95CalibrateTagDetector() properly executed in rfalInitialize (i.e. is ST25R95_TAGDETECT_CALIBRATE equals to true?)? Where did you get the value 0x64 and 0x74 for the DAC: is it the output of st25r95CalibrateTagDetector in open field on this custom board? If yes, you should rather use gRFAL.wum.CalTagDet + or - 8 for the DAC L and H values.

Can you probe the RF field in Idle mode? You just need a scope (connect the gnd of the probe to the tip of the probe and put the probe in the field and you should be able to capture the field). In idle mode, you should see field regularly (depending on WU period parameter).

Have you tried with a X-NUCLEO-NFC03A1?

rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
suads
Associate III

Hi Brian,

Yes the datasheet I used was old. I have changed the command to {0x07, 0x0E, 0x0A, 0x21, 0x00, 0x38, 0x01, 0x18, 0x00, 0x20, 0x60, 0x60, 0x74, 0x84, 0x3F, 0x00};

and Implemented the demo.c example in my project I just removed the button press in democycle function. The values 0x64 and 0x74 I have copied from an old datasheet, I am not sure about the DacDataL and DacDataH bytes. How do I get them do I need to calculate them?

If I set the discParam.wakeupEnabled = true the current drops to 400uA and it is always in state RFAL_NFC_STATE_WAKEUP_MODE and can't wake up the device.

If discParam.wakeupEnabled = false I can detect a tag but the current is to high

Also I have checked st25r95CalibrateTagDetector() everyting seems ok I am getting ERR_NONE. Currently I don't have the X-NUCLEO-NFC03A1 board.

This is the output from st25r95CalibrateTagDetector0693W000007CDC9QAO.pngRgds Suad

Brian TIDAL
ST Employee

Hi,

st25r95CalibrateTagDetector() returns the Dac Reference Value (DacRefValue). This DacRefValue is used to derive the detection guard band [DacDataL; DacDataH]:

  • DacDataL = DacDataRef – Guard and ,
  • DacDataH = DacDataRef + Guard,
  • with a recommended Guard value of 2 DAC steps (i.e. 8).

See 5.9.5 Tag detection calibration procedure in the ST25R95 datasheet.

The Dac Reference Value is stored in gRFAL.wum.CalTagDet during rfalInitialize().

So you should not use hard coded value in st25r95Idle(), but you should use (gRFAL.wum.CalTagDet - 8U) and (gRFAL.wum.CalTagDet + 8U) as in the rfalWakeUpModeStart() reference code.

I had a look to your output of st25r95CalibrateTagDetector and if I am not wrong the returned value is 0x08. This looks very strange to me. Can you make sure to run the calibration procedure with no tag within the antenna RF operating volume? Is there any shielding or ground plan under the antenna?

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
suads
Associate III

Hello Brian,

I got a X-NUCLEO-NFC03A1 board and tested my example on the board and it seems to work,(power consumption is 130uA) but the same example on my custom board dosen't work.

I have checked the schematic and it seems the antenna part differs from the X-NUCLEO-NFC03A1, I don't have any data about the antenna, I have only the schematic and I can see that they differ from the X-NUCLEO-NFC03A1 schematic. And there is another difference on the X-NUCLEO-NFC03A1 the chip is CR95HF, and on the custom board st25r95.

Brian TIDAL
ST Employee

Hi,

since the CR95HF has joined the ST25R family, ST25R95 is the part numbering (actually ST25R95-VMD5T is the full part number). The marking on the IC is still CR95HF.

Where does your custom board come from? I would suggest to check that the matching circuit follows AN5248 (ST25R95 transceiver antenna tuning circuit with EMI filter)

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
suads
Associate III

Hello Brian,

I've made some progress I have implemented wake up by tag detection on my custom board by setting gRFAL.wum.cfg.indAmp.delta from 8 to 4 but it detects only NFCA (sticker ST25TA02KB), I've tried two differrent NFC-V tags ST25TV02K(sticker) and ST25DVO4K(red pcb) it won't wake up.

When I set discParam.wakeupEnabled=false without going to sleep

It detects NFC-A ST25TA02KB(sticker) and NFC-V ST25TV02K(sticker) but it won't detect ST25DVO4K(red pcb).

I've tried the same code on the dev. board  X-NUCLEO-NFC03A1 everything works , wakeup by tag detection is working and it can detect all tags.

Do you still think it is a issue with the antenna impedance on the custom board?

Thanks, Regards Suad

Brian TIDAL
ST Employee

Hi,

what is the DAC reference value returned by st25r95CalibrateTagDetector() in open field (without a tag in the field)? if it is still around 8, I believe there is a issue in the antenna or matching circuit. Have you checked  AN5248 (ST25R95 transceiver antenna tuning circuit with EMI filter)?

Note: The recommended value for the DAC guard (gRFAL.wum.cfg.indAmp.delta) is 2 DAC steps (i.e. 8 not 4).

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.