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: Direct mode 0 MISO pin behavior

Part Number: TRF7970A
Other Parts Discussed in Thread: DLP-7970ABP

Hi,

I'm experimenting with the direct mode 0 feature of the TRF7970A on our in-house developed RFID reader. Below this post is the initialization code for entering direct mode. Entering direct mode 0 seems to work. If I toggle the MOD pin, I can see that the RF field is turned on and off.

When I measure the MISO pin, it is always toggling randomly even when there is no card in the field. If I look at the TRF's datasheet, both the text and figure 6-32 (see below) seem to suggest that the MISO pin should only toggle when a subcarrier is detected and demodulated.

What is the expected behavior of the MISO pin? To remain low when no card is in the field? And if so, am I missing some initialization step to accomplish this?

Best regards,

Martijn Bumann

/* Configure on/off keying */
gpio_set(RFID_TRF7970A_ASK_N_PORT, RFID_TRF7970A_ASK_N_PIN);

/* Initialize TRF for communication */
trf7970a_send_direct_command(TRF7970A_CMD_SOFT_INIT);
trf7970a_send_direct_command(TRF7970A_CMD_IDLE);
delay_us(1000);

trf7970a_send_direct_command(TRF7970A_CMD_RESET_FIFO);

trf7970a_write_register(TRF7970A_REG_FIFO_IRQ_LEVELS, 0x0C);

trf7970a_write_register(TRF7970A_REG_MOD_CTRL, 0x01);
trf7970a_write_register(TRF7970A_REG_REGULATOR_CONTROL, 0x01);

/* TRF7970A errata */
trf7970a_write_register(TRF7970A_REG_NFC_TARGET_LEVEL, 0x00);

trf7970a_write_register(TRF7970A_REG_ISO_CTRL,
        TRF7970A_ISO_CTRL_RX_CRC_OFF
        | TRF7970A_ISO_CTRL_DIRECT_0
        | TRF7970A_ISO_CTRL_MODE_RFID
        | TRF7970A_ISO_CTRL_RFID_ISO14443A_106);

trf7970a_write_register(TRF7970A_REG_MOD_CTRL,
        TRF7970A_MOD_CTRL_27MHZ_DIS 
        | TRF7970A_MOD_CTRL_OOK_PIN_EN
        | TRF7970A_MOD_CTRL_SYS_CLK_DIS
        | TRF7970A_MOD_CTRL_ANALOG_DIS
        | TRF7970A_MOD_CTRL_MOD_OOK_100);

/* Enable RF output and keep chip select active to remain in direct mode. */
trf7970a_write_register_keep_cs(TRF7970A_REG_CHIP_STAT_CTRL,
        TRF7970A_CHIP_STAT_CTRL_ACTIVE
        | TRF7970A_CHIP_STAT_CTRL_DIRECT_01
        | TRF7970A_CHIP_STAT_CTRL_RF_ON
        | TRF7970A_CHIP_STAT_CTRL_RF_PWR_FULL
        | TRF7970A_CHIP_STAT_CTRL_RX_MAIN
        | TRF7970A_CHIP_STAT_CTRL_ACG_OFF
        | TRF7970A_CHIP_STAT_CTRL_RECV_AUTO
        | TRF7970A_CHIP_STAT_CTRL_VIN_5V);

/* Enter direct mode with 8 SPI clock cycles. */
spi_send8(SPI3, 0x00);

/* Enable RF */
gpio_clear(RFID_TRF7970A_MOD_PORT, RFID_TRF7970A_MOD_PIN);

/* Let the card charge. */
delay_us(6000);

/* Toggle mod pin to send data to card, then sample MISO to read response. */

  • Hello Martijn,

    do you have the following document available which describes in more detail the usage of the direct modes:

    "Using Special Direct Mode With the TRF7970A"

    https://www.ti.com/lit/sloa214

    This document contains also a link to sample code:

    http://www.ti.com/lit/zip/sloa214

    Maybe this can solve some questions.

    Best regards,

    Helfried

  • Hi,

    Thanks for the document and source code suggestion. Unfortunately both mainly focus on direct mode 1 (and special direct mode). For direct mode 0 the document just refers to the datasheet.

    Best regards,

    Martijn

  • Hello Martjin,

    What is your use case here?

    We don't really have expertise on Direct Mode 0 (DM0) anymore so it may not be possible to answer this question. Our focus with the TRF7970A is to support proper NFC applications and not proprietary RFID and our support model is geared heavily towards only NFC applications where the device is capable to communication with NFC devices and tags in Direct Mode 2. The exception to that is Mifare Classic which we support using Special Direct Mode and Direct Mode 1.

    The only DM0 example code we have is for an older Mifare Classic example, I don't have any knowledge about how it works but it would show proper configuration: https://www.ti.com/tool/TRF796X_TRF7970X_MIFARE_12_2013

  • Hi Ralph,

    It is a pre-study to see if we can support some additional cards that do not strictly follow the supported protocols. I've requested access to the example code. Hopefully it will at least be useful to see if the setup routine is correct.

    Best regards,

    Martijn

  • Hello Martijn,

    Alright. I just will be explicit that we do not provide technical support to debug issues with non-NFC compliment tags except for Mifare Classic. All our investment and expertise is centered on standardized NFC tags and devices as that is far and away where the market has trended.

    Hopefully that collateral will be sufficient. You can also search on E2E for Direct Mode 0 posts. Some of our prior experts had more knowledge and maybe their previous E2E posts would be helpful for you.

  • Hello Martijn Bumann,

    Can I bother you some time about entering into direct mode 0 ?

    I tried some method but I couldn't find the method to achieve , if you can reply me I'll be very appreciate !
    email:asdf60107@gmail.com


    Best regards,

    LiEn Chang

  • Hi,

    I just wanted to let you know that today we've managed to resolve our issue. After connecting the TRF7970A from the booster pack (DLP-7970ABP) to our RFID reader (bypassing the onboard TRF) we saw the MISO pin behaving as we expected it should, i.e. remaining in a constant state until there was some manipulation of the RF field (toggling of the MOD pin by the MCU as well as the response from the tag). Turns out that the RFID reader samples I used were from the same batch of which the matching circuit is not correct. On a RFID reader from a different batch, with the correct matching circuit, the MISO pin works and the response from the tag can clearly be seen.

    The suggested DM0 example code is quite old and a bit cryptic, but it helped to confirm that the setup for entering DM0 is correct. @LiEn Chang, the datasheet, the code from my post and the TI DM0 example code should be enough to enter DM0. I'd suggest opening a new question on the forum to get answers to your questions. That also makes the information available to everyone that is struggling with the same issues.

    Thanks for your help, I'll mark this as resolved.