2019-03-06 02:06 AM
Hi i am using an cr95hf. After using an idel command and waking up afterwards any command I send after the idle wont work. I don't even get a polling response. Unfortunately I can't find anything in the cr95hf datasheet telling me if i need to reset or anything similar after exiting the idle mode. Also I am using the cr95hf as the plug and it is connected to an atmega 128 and I am communicating via SPI.
Solved! Go to Solution.
2019-03-14 07:33 AM
Hi Michael,
the antenna on the PLUG-CR95HF-B board has the following characteristics:
the antenna on the X-NUCLEO-NFC03A1 board has the following characteristics:
I will try to grab a PLUG-CR95HF-B and make some read range tests and detection range tests. On your side, can you request your local distributor to send you an X-NUCLEO-NFC03A1 board?
For your own design, ST provides the following application note and calculation tool that should help to improve the performances
Also, feel free to send to me (in private) your schematics so that I can manage to have them being reviewed by RF experts team.
Note: if you change the antenna on the PLUG-CR95HF-B, the matching circuit will need to be updated.
I would also recommend to base your firmware on top of ST RF Abstraction Layer (RFAL) firmware provided in X-CUBE-NFC3 v2.0.0: this RFAL abstracts the reader being used so that you can easily move to ST25R3911B or ST25R3916 reader in case high performances are needed without having to change your code. The RFAL can be easily tailored to fit your flash/ram constraints.
Regarding the calibration, make sure to calibrate when no tag are in in the operating volume. Make sure to have no metallic parts (cables, ...) under the antenna. With my X-NUCLEO-NFC03A1, in Idle mode, I am able to detect a Type 4A tag at ~3 cm and then able to read it.
Rgds
BT
2019-03-07 02:49 AM
Hi
here is a log file with timestamp showing the idle command being used, a tag being detected and the various polling activities being resumed.
On my side I use the following Idle command:
070E0A21003801180024606070803F00
Can you send me the command you are using on your side and a log of the data being sent/received over the SPI?
I suggest you send a echo command to check whether the CR95HF is back in active mode after the response of the Idle command.
Also feel free to have a look to x-cube-nfc3 firmware package (version 2.0.0, make sure to refresh your brower to get the latest release). The idle command over SPI is implemented as part the firmware (st25r95SPIIdle).
AN3433 calibrationalso gives some important information. In particular, before using Idle a has to be performed. This is implemented in the x-cube-nfc3 firmware package.
Thanks
Rgds
BT
2019-03-07 03:08 AM
hi,
I send the idle command {07,0E}
with the following parameters:
{0x02,0x21,0x00,0x79,0x01,0x18,0x00,0x01,0x60,0x60,0x94,0xFD,0x3F,0x01};
after the idle i get a 000102 so it is detecting a tag.
But then sending an echo or anything else wont work.
Sending an echo and polling it just wont give me the 8 telling me that polling is done.
If I send numerous comands it will at some point start returning 01020000 over and over again.
best regards Michael
2019-03-07 05:28 AM
I attached the log if you want me to format it differently let me know.
This time the echo command right after idle actually worked but the command after that already gets a unexpected(not possible) response.
The commands after the echo are from the cr95hf datasheet for nfc forum tag type2 for 14443-A. If I use these commands without the idel before hand i get a correct UID.
2019-03-07 05:50 AM
Hi Michael,
See my comment below:
Can you give more details about your setup:
I will have a deeper look to your traces.
Rgds
BT
2019-03-07 06:27 AM
I am using a custom board. The Plug is directly connected to the atmega128. I use my own driver. The MUC doesnt enter low power mode. The IDN command returns:
I poll by sending the byte 0x03 untill i get a 00001xxx where i dont care what *** is.
I did a similar thing to the calibratio but iterating over all possible values for dacref and got 94 as the first result rendering 102 instead of 101.
For the Wakeup controll the value i am using is the one stated for wkae up by tag detection.
I changed the dacLow and High to 88 and 98 and got a wake up by tag detection eventhough there is no tag even remotely close to the antenna.
2019-03-07 06:50 AM
Hi Brian,
I am currently discussing with my boss that it is possible that we are reading the bits shifted and thats why we are getting 06 instead of 08 when polling. So don't bother trying to figure out what the traces mean it is possible that our SPI reading configuration is wrong which would result in utter **** in the traces. We will inverstigate this tomorrow. I ll get back to you with the results.
Best regards Michael
2019-03-07 09:49 AM
Hi Michael,
I recommend to use <WU Source> = 0Ah in order to always be able to control the device from the MCU i.e. to be able to exit the device from wake up mode if the MCU needs to communicate with the reader.
For the calibration, feel free to reuse the st25r95CalibrateTagDetector() API from the x-cube-nfc3 firmware package provided by ST (fast 8 steps dichotomy procedure). If your DacRef is 94h, then DacL is 8Ch and DacH is 9Ch (if 94h is the value where the answer is timeout instead of tag detected, this is this the DacRef value).
For the WUCtrl parameter, the CR95HF is now named ST25R95 and the ST25R95 datasheet gives the appropriate value in table 26:
These two bytes (WuCtrlL and WuCtrlH) define the wake-up resources
This is the value used in ST x-nucleo-nfc3 firmware.
Can you resend the return value of the IDN command (it was empty in your answer).
Regarding the polling mechanism, an easy way is to simply read the GPIO status of the MCU PIN connected to the ST25R95 IRQ_OUT. See st25r95SPIPollRead() API. This signal can also trig an interrupt. Can you give more details on your polling mechanism implementation (e.g. is there a timeout implemented and how is handled the timeout)?
Can you send a polling just after the wake up reply and before sending any data and then check that the ST25R95/CR95HF reply has bit 2=1 (Data can be sent)
Rgds
BT
2019-03-08 12:57 AM
Hi thanks for your answer. I ll adjust the dacL and dach and try again. Also the idn returned :
<00><0F><4E><46><43><20><46><53><32><4A><41><53><54><34><00><2A><CE>
And right now we dont have the irq_out connected to the MUC since we thought that we dont need it when using SPI.
If I am interpreting you right you are asking if we have a timeout after polling where the chip does sth else?
We just poll right after sending the command. By sending 0x03 and reading what the chip returns in a loop until we get the bit 3= 1.
I will try polling right after we read the wake up source and see what we ll get there.
Best regards
Michael
Edit: So I polled right after reading the wakeup source and got 0x06 which means that the bit 2 is one if i am correct.
2019-03-08 02:21 AM
Hi Michael,
the IRQ_OUT is just an option (it might be an interesting option if you plan to enter the MCU in low power sleep mode and exit from this mode when there is a reply from the CR95HF)
My question regarding the polling was the following:
Other question regarding the polling:
Do you have the possibility to plug a logic analyzer on the SPI (MOSI/MISO/CLK/SS) + IRQ_IN + IRQ_OUT and provide the trace so that I can better help on investigation?
Thanks
Rgds
BT