2019-06-14 11:53 AM
I have this NFC reader connected as slave using UART.
The IC normally works fine (using the UART StartUp Sequence), but some times stuck (this is another issue), If We try to get the ECHO command, never gets back the 0x55, means CR95HF is stacked, the only way to making work is to PowerUp.
I been trying to RESET the CR95HF using the PowerUp sequence (without PowerUp the IC) but I have no success.
is there any sequence to perform the Reset using the UART?
Thank you
Solved! Go to Solution.
2019-06-17 12:34 AM
Hi
the Reset command is only available through the SPI interface. When using UART, only IC power cycle can reset the CR95HF.
Rgds
BT
2019-06-17 12:34 AM
Hi
the Reset command is only available through the SPI interface. When using UART, only IC power cycle can reset the CR95HF.
Rgds
BT
2019-11-21 08:26 PM
Hi @Brian TIDAL_O you've stated that the CR95HF, using UART, can only be reset with an IC power cycle. However, the CR95HF datasheet states the following;
If the user loses UART synchronization, it can be recovered by sending an ECHO command until a valid ECHO reply is received. Otherwise, after a maximum of 528 ECHO commands, CR95HF will reply with an error code meaning its input buffer is full. The user can now restart a UART exchange.
I have three questions, which may also help the original poster (@LM ) too.
Thank you in advance for your time and consideration in answering my questions.
Best Regards,
Dion
2019-11-22 05:09 AM
Hi,
here are some answers
1/ this is not a method that resets the UART. This is a way to recover when host and device lose synchronization. When the host (MCU) is reset, the CR95HF is not reset unless a power cycle is performed. Therefore, if the host is reset during an UART transmit, then the CR95HF UART buffer may be not empty when the host restarts:
For case #1 and #2, host and device are unsync. In order to be able to communicate, it is needed to complete the current command with dummy data. This can be done with echo characters that will fill the UART buffer until LEN is reached (note: for case #2, the first 0x55 sent will be considered as the LEN parameter). Once the buffer contains the full command, it will be processed and response code will be sent. This response code can be ignored.
For case #3, the host and device are sync and the device will properly answer to the echo command
For case #4, the host and the device are unsync. The echo command will not be processed. After a certain time, the host will receive the answer of the current command. This response code can be ignored.
2/ In case a loss of synchronization between the host and the device and after sending enough 0x55 dummy data, the CR95HF sends the response code of the command. This response code can be ignored.
3/ nothing special is needed, just sent the next command. Anyway, I would recommend to sent ECHO then IDN then PROTOCOL SELECT Field OFF.
The following algorithm can be implemented at startup
set retry to max LEN value
send echo:
Anyway, the only way to have a robust init sequence is to power cycle the device when the host resets.
Rgds
BT