Other Parts Discussed in Thread: WMBUS, , CC1312R
Hi,
I want to read a status register to get some information about a received rf packet.
I use a CC1310 Launchpad as a wMBus receiver and I have different wMBus senders. Some of them send in T mode and some in C Mode. (I verified it with other software and hardware.)
Since https://www.ti.com/lit/an/swra522e/swra522e.pdf?ts=1638195288205&ref_url=https%253A%252F%252Fwww.google.com%252F point 2.4 it should be possible to read which format the via RF received wMBus packet had. I used the TMR to find out how to do that and implement a code like this:
/* Check which mode packet had */ uint8_t wMBusMode = 0; rfc_CMD_READ_RFREG_t readRegCmd = { .commandNo = CMD_READ_RFREG, .address = 0x5178, .value = 0 }; RF_Stat status = RF_runImmediateCmd(rfHandle, (uint32_t*)&readRegCmd ); if (status == RF_StatCmdDoneSuccess ){ wMBusMode = readRegCmd.value & 0x01; //wMBusMode = 0 means T-mode Packet, wMBusMode = 1 means C-Mode Packet }
But the result is not correct. As result I mostly get 1 and it does not matter whether my sender send in T-Mode or C-Mode.
Is there something wrong with the Code? Do I have to do that before or after watching at the next entry with "RFQueue_nextEntry();"?
Best Regards
SB