echo CR95HFV5
I have problem to to read from the chip.
The Datasheet is used is the: DocID018669 from ST
At first i want to try the echo command to know if the chip is available.
Hardware Connections:
SSI_1 to GND
SSI_0 to 3.3V
SPI-Interface(CLK/CS/MISO/MOSI) to MCU
SPI_Interuppt_IN(UART_RX) to MCU GPIO
for the CS/SSI_1/SSI_0/SPI_Interrupt i used a 3.3K pull up resistors
The for the SPI_CLK I try different frequency below 2MHz for example : 800KHz
For the Code I show you some pseudocode so someone can tell me if i make a failure:
MCU_Init();
SPI_start();
/*toggel Intterupt for Boot up Sequence*/
writeGPIO(RFID_Interrupt_In,HIGH);
delayMS(1);
writeGPIO(RFID_Interrupt_In,LOW);
delayMS(1);
writeGPIO(RFID_Interrupt_In,HIGH);
delayMS(20);
/*Sende Echo command*/
txBuffer[0]=0;
txBuffer[1]=CR95HF_CMD.ECHO;/*0x55*/
SPI_Write(txBuffer,2);
while(1){/*never return*/
/*Send Poll Command*/
txBuffer[0]=CR95HF_CMD.POLL;/*0x03*/
SPI_Write(txBuffer,1);
/*wait until Chip respons with ready*/
SPI_Read(rxBuffer,1);
if(rxBuffer[0] & 0x08 >>3){/*never come inside here*/
txBuffer[0]=CR95HF_CMD.READ;/*0x02*/
SPI_Write(txBuffer,1);
SPI_Read(rxBuffer,1);
printf("Echo: %u \r\n",rxBuffer[0]);
break;
}
printf("Inside Loop\r\n");
}For better understanding I add a picture of the SPI Communication.
In the Picture:
yellow: SPI_CLK
blue: CS
red: MOSI
green: MISO
Can someone help me why the Chip is not responding?
