Part Number:TRF7970A
Hello,
I am working with NXP's MK22FN1M0AVLQ12, along with the TRF7970A, in their MCUXpresso IDE v10.3.1.
I'm already able to communicate with the TRF reader over SPI, and read/write tags. The problem I'm currently having is with reading RSSI relative to the tag.
As I move the tag closer to the reader, I get external RSSI values closer to 7, which makes sense.
As I move it farther from the reader, I move from 7 towards 3, and then suddenly lose connection. This makes less sense - I should be going down from 7 to 0, before losing connection. I am wondering if I am doing something wrong with regards to methodology used for reading RSSI.
I'm using a 5V input setup.
The values of the TRF registers before I run the Read Rssi Command are:
Register: 0 Value: 21
Register: 1 Value: 88
Register: 2 Value: 0
Register: 3 Value: 0
Register: 4 Value: c1
Register: 5 Value: 9d
Register: 6 Value: 20
Register: 7 Value: e
Register: 8 Value: 7
Register: 9 Value: 1
Register: a Value: 20
Register: b Value: 7
Register: c Value: 0
Register: d Value: 3e
Register: e Value: 17
Register: f Value: 40
Register: 10 Value: 0
Register: 11 Value: 0
Register: 16 Value: 0
Register: 17 Value: 0
Register: 18 Value: 0
Register: 19 Value: 0
Register: 1a Value: 0
Register: 1b Value: 0
Register: 1c Value: 0
Register: 1d Value: 0
Register: 1e Value: 0
Register: 1f Value: 3a
And here is my actual read rssi function:
void Trf7970ReadExternalRssi(uint8_t *pbuf)
{
/* Methodology described in TRF7970A datasheet page 28 */
/* Turn on receiver for external RF field measurement */
command[0] = CHIP_STATE_CONTROL; // CHIP_STATE_CONTROL = 0x00
command[1] = V_IN_5V_RF_ON_REC_ON; // V_IN_5V_RF_ON_REC_ON = 0x23
SpiWriteSingle(command);
/* Enable receiver */
command[0] = RUN_DECODERS; // RUN_DECODERS = 0x17
SpiDirectCmd(command);
/* Send command to measure RSSI */
command[0] = CHECK_EXTERNAL_RF; // CHECK_EXTERNAL_RF = 0x19
SpiDirectCmd(command);
/* Delay by more than 50 us */
PIT_MicrosecondDelay(200); //delay by 200 us
/* Read RSSI register */
*pbuf = RSSI_LEVELS; // RSSI_LEVELS = 0x0F
*(pbuf+1) = SPECIAL_FUNCTION; // SPECIAL_FUNCTION = 0x10
SpiReadCont(pbuf, 2);
/* Revert Chip state control reg to receiver turned off */
Trf7970TurnRfOn(); //Write 0x21 to the CHIP_STATE_CONTROL register
}
If there is any other information that might be helpful for me to provide, please let me know what that might be!
Thanks,
Ben