I'm using this arduino library to initial & communicate with my MFRC522 chip,library initially used SPI interface for communicating between MCU & RC522.When I'm using it in the SPI interface every thing is OK & correctly operate. Now I'm trying to change interface to the UART mode. Based on the MFRC522 datasheet from NXP,I setted pin status for UART mode. Also reading & writing sequences & UART framing address are based on datasheet. Also when I read VersionReg register of RC522 it successfully returned me 0x92 which mean it is V 2.0 but it can't detect presence of RFID tags. Is there any other differences between SPI & UART interface or any extra setting I must do? Has any one experiences with using this chip in UART mode?
My changes in register read & write functions:
unsigned char ReadRawRC(unsigned char Address)
{
unsigned char ucAddr;
unsigned char ucResult=0;
ucAddr = Address | 0x80;
UART_SendBlocking(USART0, &ucAddr, 1);
UART_ReadBlocking(USART0, &ucResult, 1);
return ucResult;
}
/////////////////////////////////////////////////////////////////////
//@ Function: write RC522 register
//@ Parameter Description: Address [IN]: register address
//Value [IN]: write value
/////////////////////////////////////////////////////////////////////
void WriteRawRC(unsigned char Address, unsigned char value)
{
unsigned char ucAddr;
unsigned char ucValu;
ucAddr = Address & 0x7F;
ucValu = value;
UART_SendBlocking(USART0, &ucAddr, 1);
UART_SendBlocking(USART0, &ucValu, 1);
}