' Clocktrim level for Micromite2/MMBasic ' determines the value for Option ClockTrim n ' using the DS3231 32768hz signal (32kHz TCXO). ' Released by twofingers@TBS 18.09.2015 ' Provided AS IS. No warranty. ' ' You need only to connect a wire from ' DS3231/32kHz Pin 1 to a MM2 (COUNT) pin (e.g. 16) Option EXPLICIT Dim integer freq,ctrim SetPin 16,fin Pause 2000 freq=Pin(16) ctrim=Cint(freq-32768)/15 'Print freq, ctrim If Abs(ctrim) < 10 Then Option ClockTrim ctrim Print "ClockTrim is set to "ctrim Else Print "Error! Please check 32khz signal. Freq="freq EndIf