Starting Electronics needs your help! Please make a donation to help cover our hosting and other costs. Click the donate button to send a donation of any amount.
Created on: 25 April 2013
Part 7 of the ATtiny2313 Tutorial
The system clock for the ATtiny2313 can be selected from a number of different sources: from an external clock source, internal 4MHz RC oscillator, internal 8MHz RC Oscillator, watchdog internal 128kHz oscillator or an external crystal / ceramic resonator.
The clock source can be selected by programming fuse bits in the microcontroller so that the desired clock source will be used by the microcontroller at startup.
Atmel Studio can be used to program the clock source selection bits. There is also a fuse bit that can be programmed in order to divide the clock source by 8 – the CKDIV8 fuse bit.
The system clock can be output on pin 6 of the ATtiny2313 by setting the CKOUT fuse bit.
This video shows the CKOUT bit being set so that the system clock can be viewed on an oscilloscope. Various system clock sources are then selected by setting the appropriate fuse bits using Atmel Studio.
Can't see the video? View on YouTube →
The image below shows part of the Device Programming dialog box from Atmel Studio – the default clock settings can be seen.
A new ATtiny2313 will have the default factory settings of the clock fuses set as follows:
This means that the system clock is set to 1MHz by default: 8MHz ÷ 8 = 1MHz.
Books that may interest you: