This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TRF7970A can not detect bit collision every time

Other Parts Discussed in Thread: TRF7970A

Hi  Members ,
 
I'm working on a RFID project with TI's platform-----TRF7970A  .
I did some experiments on TI's EVM,and  found some issues I can't understand, so.... I'm here.
 
HardWare:
TI  TRF7970A EVM + 430UIF
 
SoftWare:
TI TRF7970A C code example---sloc250
 
 
I got 2 Mifae cards , the UIDs are below(My Nexus4 give this infomation): 
card1:  8C C2 C6 08     ATQA:0x0400
card2:  1E 8B C9 C4     ATQA:0x0400
I find some times the reader chose card1 and some times it chose card2. so I deeply check TI's  excample code , and find that the TRF7970A can't successfully detect bit collision  each time.  
The following is my test procedure.
1) I put the two cards together intentionally to test the bit collision.   ATQA is no difference ,so bit collision will not happen when PCD send REQA command.
2)Fuction  Iso14443aLoop(u08_t 0x93, u08_t 0x20, u08_t *uid) then used.
 In theory, bit collision should be detected immediately after  this fuction sent . However, It doesn't .
 You can't set a breakpoint in bit collision error branch in fuction Trf797xISR , Because Iso14443aLoop is a recursive fuction, this also mislead me at first. 

3) So I define a  16bit-variable TEST_coll,  and insert  TEST_coll = 0xAA55;  in  Iso14443aLoop  in the following location.

if(i_reg == 0x02) // if collision occured go into anticollision
{
coll_poss++; // reader returns coll_poss - 1
for(i = 1; i < 5; i++)
{
new_uid[i - 1] = buf[i]; // Copy new UID from local buffer and
} // assign number of valid bits to nvb

McuCounterSet();
COUNT_VALUE = COUNT_1ms * 1.2; // 1.2ms for TIMEOUT
START_COUNTER; // start timer up mode
i_reg = 0x01;
while(i_reg == 0x01);
Iso14443aLoop(select, coll_poss, new_uid); // recursive call for anticollision procedure
}

TEST_coll = 0xAA55;

if(more == 1)
{
// perform anticollison command for 7 or 10 - byte UID - recursive call for cascade levels
Iso14443aLoop(select, nvb, uid); // only the select field is different, everything else is the same
if(stand_alone_flag == 1)
{
found = 1;
}
}

4)Set a breakpoint in the following  location. 

if(rx_error_flag == 0x02)
{
   i_reg = 0x02;
}

_NOP(); //-------------Set breakpoint.


if(i_reg == 0xff) // if data received


    switch(select)
     {
        case 0x93:

       ......

       case 0x95:

     .......

       case 0x97:

     }

}

5) Add  i_reg and  TEST_coll  to watch window. You'll find i_reg=0xFF , TEST_coll = 0   very ofen.

That means TRF7970A doesn't detect the bit collision this time.

 if i_reg = 0x02 ,TEST_coll=0 . Cool!  This is I need relsult. 

 if TEST_coll =0xAA55 , it means Iso14443aLoop run its second time for recursive purpose , discarding this  invalid result.

If you want run the code again, reset the code and run again. 

Test procedure over!~

msb                  lsb
8C--> 1 0 0 0 1 1 0 0
1E--> 0 0 0 1 1 1 1 0 -------------------->
In a normal circumstance ,  PC will jump into bit collision error branch in fuction Trf797xISR(u08_t *irq_status) ,then return 0x9E(0x8c | 0x1E), collisition register  value= 0x21. and variable i_reg = 0x02. If fails , PC jump into RX complete branch,return  i_reg=0xFF.  This different returned values  cause the reader chose a different card, and my application doesn't permit this happens .
Besides, I see the example code excute Iso14443aAnticollision(0x00) for three times in one loop.  I think it's enough to execute  Iso14443aAnticollision(0x00) for
one time if it is stable. so , I comment the other 2 Iso14443aAnticollision. and I found it read a wrong UID very ofen.
Any clue will be appreciated ....
 Many thanks.
 
B&R,
SeaFease.