Hi,
I'm currently migrating products from MC13224V to Kinetis Kw21D256 processors, using the TWR as a starting point, no problems there.
Have designed new boards for the actual product and have a problem with the 32MHz modem oscillator.
In document https://cache.freescale.com/files/rf_if/doc/ref_manual/TWR-KW2XHWRM.pdf?fpsp=1 and in the kw Reference Manual MKW2xDxxxRM.pdf it is mentioned that the MC1324 modem has a feature that allows using trim caps internal to the silicon that allow the 32MHz crystal oscillator to be software trimmed.
For example in the reference manual :
"As described in “Crystal Trim Operation”, the modem crystal oscillator frequency can be
trimmed by programming modem XTAL_TRIM register. The trimming procedure varies
the frequency by a few hertz per step, depending on the type of crystal. As the
XTAL_TRIM register value is increased, the frequency is decreased. This feature is
useful for factory calibration of the crystal frequency to set the accuracy for the radio as
required by the 802.15.4 Standard."
However there is no XTAL_TRIM register mentioned in the modem registers section and no Crystal Trim Operation" section. I've checked all the direct and indirect register docs - nothing there.
Does the Mkw21D256 modem have the crystal trim feature mentioned in the docs?
If so, how is it accessed?
John
Dear John,
The XTAL_TRIM is indirect register 0x01 as stated in chapter 9.3.2 XTAL 32 MHz Trim (Indirect Modem_XTAL_TRIM) of Reference manual. The document mentions some sections that seem not to be included indeed. This will be fixed and updated soon.
If you would like to change the TRIM settings, I would recommend you to load the Connectivity Test application using SMAC codebase included in Beekit installation (C:\Program Files (x86)\Freescale\SMAC\MKW2x\Demo Apps\Connectivity Test). You will be able to modify the TRIM settings from a simple yet useful serial port menu. You could also check how this is done in code in PhyXtalAdjust() function.
Regards,
AngelC
Hi AngelC, its actually John, not Benjamin.
Thanks for that, was using a reference manual that was a tad out of date. Have the latest now.
I'm developing production tools, so not really practical to use Connectivity Test app. The new manual describes the XTAL_TRIM indirect reg as 8 bits, advising to check EXTAL32M section for details, however there are none,
How do the 8 bits of XTAL_TRIM specify the internal capacitance switching that is used to trim the 32M osc?
I looked for PhyXtalAdjust() in my project built with BeeKit originally, but not in source, must need a later version of BeeKit. Currently using BeeKit 3.0.1.
John
Hi AngelC,
Just got the latest BeeKit 3.0.2 and built a Kw21D256 HA project, works fine.
Also, have discovered an error in uart.h relating to using 8 bit data, with parity. The error was discovered in 3.0.1 and is still in projects generated using 3.0,2 :
/* Data bits mask */
#define gUART_DATA_BITS_BIT_c (0x8u)
That should be
/* Data bits mask */
#define gUART_DATA_BITS_BIT_c (0x10u)
Thats the UARTX_C1.M bit setting, It currently incorrectly sets the UARTX_C1.WAKE bit.
John