$FREQUENCY - Processor frequency

$FREQUENCY - Processor frequency

Language reference ›› Directives ››
Parent Previous Next

frequency-directive = $FREQUENCY integer-expression [ multiplier ] .
multiplier = ( HZ | KHZ | MHZ ) .


This directive defines the processor operating frequency.


This directive overrides the default option defined in the Project's Options.


It is not allowed in units since they use the main program declaration.

A frequency multiplier suffix may be used (4000 KHz, 8 MHz …), but dots are not allowed (4.5 MHz is forbidden, use 4500 KHz instead). Case is not sensitive (since mHz can't be one thousandth of Hertz!).

A CONST pseudo variable named FREQUENCY holds the value in Hz and may be used in expressions.



{$IFDEF LOW_POWER}
 {$FREQUENCY 31000}
{$ELSE}
 {$FREQUENCY 20 MHz}
{$ENDIF}

 IF FREQUENCY > 4000000 THEN