cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3918 Read Register Shift Right

zeynepdicle
Associate III

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.

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
Brian TIDAL
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Ulysses HERNIOSUS
ST Employee

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

yes, when I modified st25r3916ReadRegister it read like this
modiRead.PNG


when I didn't modified st25r3916ReadRegister it read like this
notModiRead.PNG


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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
zeynepdicle
Associate III

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();
}

Brian TIDAL
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.