CONFIG CLOCKDIV/de

From MCS Wiki AVR
< CONFIG CLOCKDIV(Difference between revisions)
Jump to: navigation, search
(Created page with "= <span class="f_Header">Action</span> = Sets the clock divisor. <span style="font-family: Arial;"> </span> <span style="font-family: Arial;"> </span> = <span cl...")
 
m (1 revision)
 

Latest revision as of 21:13, 15 February 2013

Contents

= (**COPIED FROM ENGLISH PAGE**) === Action

Sets the clock divisor.

 

 

Syntax

CONFIG CLOCKDIV = constant

 

Remarks

constant

The clock division factor to use. Possible values are 1 , 2 , 4 , 8 ,16 , 32 ,64 , 128 and 256.

 

The options to set the clock divisor is available in most new chips. Under normal conditions the clock divisor is one. Thus an oscillator value of 8 MHz will result in a system clock of 8 MHz. With a clock divisor of 8, you would get a system clock of 1 MHz.

Low speeds can be used to generate an accurate system frequency and for low power consumption.

Some chips have a 8 or 16 division enabled by default by a fuse bit.

You can then reprogram the fuse bit or you can set the divisor from code.

 

When you set the clock divisor take care that you adjust the $CRYSTAL directive also.

$CRYSTAL specifies the clock frequency of the system. So with 8 MHz clock and divisor of 8 you would specify $CRYSTAL = 1000000.

 

 

See also

$CRYSTAL

 

 

Example


CONFIG CLOCKDIV = 8 'we divide 8 MHz crystal clock by 8 resulting in 1 MHz speed

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language