AnsweredAssumed Answered

Possible error in clock init, MQX 3.8 BSP: bsp_twrk60f120m  bsp_cm.c pll_init() line 349

Question asked by TugboatCaptain on Jun 21, 2012
Latest reply on Jun 22, 2012 by David E Seymour

MQX 3.8 (CW10.2)

in BSP: bsp_twrk60f120m   Rev #: 3.8 Modified: 1/31/2012

file: bsp_cm.c

function: pll_init()

Line 349 appears to have an error and likely should be an OR-EQUAL (|=) instead of EQUAL (=) assignment.

Otherwise the AND-EQUAL (&=) line above it has no function.  Without it, it never clears the IREFS and always returns 0x11 and stays clocked by the internal ref clock and throws off the timer calculations.


code snippet: 

temp_reg = MCG_C1;


temp_reg = MCG_C1_CLKS(2) | MCG_C1_FRDIV(frdiv_val);

MCG_C1 = temp_reg;


My bsp_cm.c file is dated 12/28/2011.  


I installed it 2/29/12 from FSLMQX_3.8.0_TWRK60F120M_PATCH.exe which seems to match the current one in the downloads area.


I have derived a BSP from this one.  Is there a list anywhere of changes and corrections for the bsp_twrk60f120m  BSP?