2023-09-24 11:47 PM - edited 2023-09-24 11:55 PM
Hello,
I'm working on a project where I'm using the ST25R3918 with RFAL libraries. Initially, I read the IC identity register and performed a right shift. Why did I perform this right shift?
I modified the read register function, added a right shift, and successfully read the correct registers. However, my code is now not functioning correctly.
What steps should I take to resolve this issue?
This version maintains the same information while improving the clarity and correctness of the sentences.
Solved! Go to Solution.
2023-09-25 04:47 AM - edited 2023-09-25 04:48 AM
Hi,
as explained by Ulysses, make sure your SPi is properly configured. See chapter §4.3.3 Serial peripheral interface in the datasheet. If using CPOL = Low then CPHA should be 2 Edge.
Rgds
BT
2023-09-25 12:34 AM
Hi,
do you mean you have modified the st25r3916ReadRegister function inside the RFAL? I would recommend to not modify the RFAL source.
For your information, the IC identity register is checked during the RFAL initialization. Can you share more details on why you need to read it ?
Rgds
BT
2023-09-25 12:37 AM
Hello zeynepdicle,
reading shifted values from registers is typically an effect of using an incorrect SPI mode in your driver. Please check this.
If still not consistent then also share scopeshot / logic analyzer trace of the read of the IC identity register.
BR, Ulysses
2023-09-25 01:28 AM - edited 2023-09-25 01:29 AM
yes, when I modified st25r3916ReadRegister it read like this
when I didn't modified st25r3916ReadRegister it read like this
2023-09-25 04:47 AM - edited 2023-09-25 04:48 AM
Hi,
as explained by Ulysses, make sure your SPi is properly configured. See chapter §4.3.3 Serial peripheral interface in the datasheet. If using CPOL = Low then CPHA should be 2 Edge.
Rgds
BT
2023-09-28 01:15 AM - edited 2023-09-28 01:20 AM
Hi again,
I have another question. I am using the ST25R3918 and the 'pollingTagDetect' example from the RFAL library. I added the 'st25r3916WriteRegister' function for my hardware, but this code doesn't work. The 'switch case' in the 'rfalWorker' doesn't get executed. How can I resolve this issue? When I examine the debugging steps, I noticed that 'gRFAL.state' doesn't enter any case.
spiInit(&hspi1);
if(!demoIni()) {
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_12, GPIO_PIN_SET);
}
st25r3916WriteRegister(ST25R3916_REG_IO_CONF1, (ST25R3916_REG_IO_CONF1_single | ST25R3916_REG_IO_CONF1_rfo2 | ST25R3916_REG_IO_CONF1_out_cl_disabled| ST25R3916_REG_IO_CONF1_lf_clk_off_on ));
while (1) {
demoCycle();
}
2023-09-28 05:24 AM
Hi,
I would suggest to create a new thread rather than posting a question on an already answered one.
Rgds
BT
P.-S. it is likely that demoIni() returns false. Make sure to enable the selftest feature (ST25R_SELFTEST and ST25R_SELFTEST_TIMER) and check the return code of the st25r3916Initialize