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: IRQ problem - ISO15693

Part Number: TRF7970A
Other Parts Discussed in Thread: MSP430G2553, MSP430F2370

Hi,

for the past few days i'm programming TRF7970A EVM with my own source code. I would like to read ISO15693 tag ID. 

My problem is that TRF7970 keeps sending me interrupt on IRQ pin (13)  with frequency around 2kHz and if i read value of IRQ status register i get (0xC6). 

My TRF initial settings are: 

Delay_ms(2);
SPI_SS_HIGH; 
Delay_ms(4);
ENABLE;
Delay_ms(1);

SPI_send_command(SOFT_INIT);
SPI_send_command(IDLE);
Delay_ms(3);
SPI_send_command(RESET);
Delay_ms(2);

*spi.txbuf = 0x31; //Chip status control
*(spi.txbuf + 1) = 0x02; //Iso control
*(spi.txbuf + 2) = 0x00; //ISO mode Option 1
*(spi.txbuf + 3) = 0x00; //ISO mode Option 2
*(spi.txbuf + 4) = 0xC1; //TX timer
*(spi.txbuf + 5) = 0xBB; //TX timer low
*(spi.txbuf + 6) = 0x00; //TX Pulse length Control
*(spi.txbuf + 7) = 0x25; //RX No Response Wait time
*(spi.txbuf + 8) = 0x1F; //RX Wait time
*(spi.txbuf + 9) = 0x31; //Modulator control
*(spi.txbuf + 10) = 0x40; //RX special settings
*(spi.txbuf + 11) = 0x87; //Regulator control


SPI_write(12, CHIP_STATUS_CONTROL);
Delay_ms(1);

*spi.txbuf = 0x3F; //Enable no response interrupt
SPI_write(1, IRQ_MASK);

*spi.txbuf = 0x00;
SPI_write(1, NFC_TARGET_LEVEL );

And my commands for reading tag ID:

SPI_send_command(RESET);
SPI_send_command(TRANSMIT_CRC);

spi.txbuf[0] = 0x26;
spi.txbuf[1] = 0x01;
spi.txbuf[2] = 0x00;

FIFO_write(3);

Can you please give me some advice what i'm doing wrong

  • from a high level, you need to encompass the "write continuous" and "# of bytes to be sent" in your string

    like this:

  • Hello Jan,

    What Josh said is correct.

    That said, I don't recommend you develop your own firmware from scratch. Please leverage TI examples as we have spent a lot of time and effort to create robust code which handles the device correctly including with error recovery. You would be doing yourself a disservice to 'reinvent the wheel' by trying to go down this road on your own. Trust me, it's a long road.

    I would recommend leveraging this code example: http://www.ti.com/lit/zip/sloc297

  • Josh Wyatt: My FIFO_write() functions performs writing number of bytes into TX_LENGTH_ register 1 and 2. I have the same waveform of MOSI line as is on your waveform picture. So i think it is not the problem with sending commands to FIFO, but maybe with handling the interrupts. Because when i send this command the TRF7970 responds with IRQ and IRQ status = 0x80 which means that TX is complete. But i don't know what goes wrong further on.
    Ralph Jacobi: I tried opening source code that you send me but i cannot build it in CCS. It shows this error: make: *** No rule to make target `clean'. Stop. Am i forggeting something?

    Thanks for all your replies.

    Jan
  • Hello Jan,

    The code example is for the MSP430G2553, so not sure if you are already trying to adapt it to the MSP430F2370? Without any modifications though it should build correctly right out of the .zip, haven't heard of anyone having an issue with that. Did you modify it at all? If not, what CCS version are you using and what compiler version is being used to compile it?
  • I see. My CCS is 7.1.0 and compiler version is TI v16.9.1.LTS. Do i need to adapt it for MSP430F2370, and what should i adapt?
  • Hello Jan,

    I tried with CCS V7.2 and LTS v16.9.3 and had no issue, but do note you need to change the output format from 'legacy COFF' to 'eabi (ELF)'.

    If you plan to use the whole TI example as is, I can find the port I did for the TRF7970AEVM and provide it to you shortly. That'd be faster for both of us than me trying to walk you through all the changes needed.

    It seems like you already moved the resistors to support SPI mode rather than parallel mode on the hardware, is that the case?
  • Ok i will update my CCS version.

    If you can provide me source code for TRF7970AEVM that would be great.

    Yes i already moved the resistors so SPI is working fine.

    Jan Slapsak
  • Thank you for sending me the project. I will try it and report back on how it works.

    Best regards,

    Jan Slapsak

  • I tried with your project and it worked. I was curious what was wrong with my code in i suppose my interrupt handling wasn't written properly. I also noticed that if a tag is present in a field of TRF7970 while RF recievers and transmitters are turned on and if you remove tag from the field TRF7970 sends an interrupt. So now i'm disabling RF transmitter and receiver after i get ID from the tag and that's it. Thank you for your time and help.

    Best regards.

    Jan Slapsak