Page 1 of 1

System Variables Not Updated In Modules

Posted: 10 Feb 2011 04:24
by BarryP
I Have a Module That adjusts the Actual Clock & timer values Based on the Set System Clock

Code: Select all

module Interrupt_C8051

   Include "Global"
   '#define TMR3_Div12
   #IFDEF TMR3_Div12 Then
          const TMR3_100uS_Reload as word = 0xFFFF - ((Clock_Khz *1000) / 12 / 10000)   ' TMR3CN.T3M = 0
   #ELSE
   
          const TMR3_100uS_Reload as word = 0xFFFF - ( Clock_Khz / 10)        ' TMR3CN.T3M = 1       22118400
   #ENDIF
..... etc
This will Only Reflect a Change after a compile in TMR3_100uS_Reload , If I Modify The Module Or Delete the MCL

Re: System Variables Not Updated In Modules

Posted: 10 Feb 2011 14:36
by filip
Hi,

If you use Clock_kHz built-in routine you must do this, in order to reflect the changes.

Regards,
Filip.