Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Clock, Timer, Xtal, Serial andTOSCI confusion

2006-01-14 by Ralph Hilton

On Sat, 14 Jan 2006 12:46:16 -0000 you wrote:

>Hi, I want to build a simple ATmega16 device with no xtals if possible
>and I am confused after reading the ATMega16 data sheet.
>
>1. Do the timer intervals rely on the frequency of the main xtal or do
>they somehow automatically change if you change the main xtal.
>2. If you have no xtal does this affect the timers much?
>3. Will the Timers work if you have no Xtal connected to the TOSCI pins?
>4. Does the Xtal frequency affect the serial input baud rate?

The clock source depends on the settings of the CKSEL fuses. If you change the xtal
frequency or clock mode then timer operation is affected proportionately.

If you have no xtal and no external clock source then the fuses need to be set for RC
operation. The timers work but are much less accurate and too imprecise for serial port
use.

The xtal frequency determines the baud rate in conjunction with the UBBR value as covered
in the section on the USART on P. 145.

The TOSCI xtal is optional and is for an asynchronous use of timer2 - that is covered in
the section on timer2 in the datasheet P. 116.

--
Ralph Hilton
http://www.ralphhilton.org
C-Meter: http://www.cmeter.org
FZAOINT http://www.fzaoint.net

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.