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. */