It's been quite an interesting journey getting the MC12311 to function as my TPMS receiver. The transmitter I'm using is the FXTH87 and, unlike the FXTH87, the MC12311 requires an intermediate codebase to interface between the RF transceiver and application code. I'm not a software guy and I can't speak in depth but I can say that SMAC is one of these intermediate codebases.
Writing a SMAC interface would be a very big task if you had to do it yourself, so Freescale provides BeeKit to do it for you. The task of writing the SMAC code is complicated by the task of making it compatible with several different hardware platforms and, further, several different operating modes on each hardware platform. This last task of making it cross-compatible is, I believe, somewhat incomplete.
The MC12311 has two main packet modes, variable length and fixed length. Each packet mode requires slightly different information to be contained in the packet that is being received over the air. When in variable length packet mode, the received packet must contain a length byte which tells the receiver how many bytes of data are in the packet. In fixed length packet mode this length byte is not needed, however, payload length must be programmed into the PayloadLength configuration register.
The problem with the SMAC code is that the RxPacket typedef is hard coded to always need a length byte regardless of which packet mode is being used. Further, the RxPacket is also hard coded to always need a destination address byte even if you are not using address matching. After being received, the RxPacket is processed by several PHY functions that are part of the SMAC and if the length byte and destination address are not present, in precise locations within the packet, the RxPacket is processed in such a way that the RxStatus bit becomes corrupted. There are functions that need a "success" indicator for RxStatus and if it is corrupted, "success" is not indicated and packets are no longer received.
As far as I can tell, there is no easy way to eliminate the need for a length byte and a destination address byte. In battery operated applications like TPMS where every ounce of power is desired to be conserved and used wisely, it's inefficient to force the transmitter to send two extra bytes that are not needed or wanted.
Cesar | Jason | Luis (or anyone who knows),
Is my description accurate?
Is there an easy way to remove the need for length and address?
From what I see, the SMAC code will essentially need to be re-written in order to use the MC12311 fixed length packet mode; otherwise variable length with destination address must always be used.