[mc1322x] suggestions for code errata
Peter Lawrence
majbthrd at gmail.com
Fri Oct 9 13:17:46 EDT 2009
Hopefully, I'm not duplicating what has already been said. I scanned
through the mailing list archives, and I don't think I saw anything
related.
#2 in particular seems like something that might help others who were
also perplexed as to why received packets were getting lost.
Two things I found to be odd with the mc1322x code are:
1) Line 344 of maca.c (set_power() function) looks suspect:
reg(ADDR_POW2) = (ADDR_POW1>>18) | PAVAL[power];
It just seems odd that one would write the MSBs of the value of the
address of register POW1 into the register POW2.
2) XTAL_CNTL is not initialized
The MC1322x Reference Manual in Sections 3.6.3 and 5.4 stresses the
importance of writing appropriate values to this register to trim the
frequency.
My experience with the mc1322x test code as presently written (which
uses the default-at-reset XTAL_CNTL values of zero) is that it will
intermittently fail to receive packets from another 802.15.4 device.
These trim values seem to be hardware dependent, and the reference
manual does not establish a procedure for determining the correct
values. (Presumable, it involves going in a continuous transmit test
mode and measuring the frequency of the RF waveform with calibrated
equipment.)
However, the RM suggests 0x15 coarse and 0x10 fine as starting values.
Using those, I experience much better reception of packets.
So, if you experience the same problems, it may be worth trying to
write XTAL_CNTL with, say, the value of 0x28E0F52 to see if reception
improves.
More information about the mc1322x
mailing list