ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Воскресенье
7 июля
194542 Топик полностью
MBedder, терминатор (18.05.2010 23:45, просмотров: 161) ответил AU_ на В ATmega1281/2561 тактовую частоту можно теоретически поделить в 2, 4 и т.д. раз. На практике не получается. После замены значения в CLKPR (Clock Prescale Register) с 1 на 2 ерунда какая-то. Где искать? Может переход c 8 на 4 Мгц надо как-то хитро делать?
Конечно, хитро - надо еще использовать регистр RTFM 
To avoid unintentional changes of clock frequency, a special write procedure must be followed to change the CLKPS bits: Write the Clock Prescaler Change Enable (CLKPCE) bit to one and all other bits in CLKPR to zero. Within four cycles, write the desired value to CLKPS while writing a zero to CLKPCE. Interrupts must be disabled when changing prescaler setting to make sure the write procedure is not interrupted.