






























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
its for cmp3006 and 3010 some of the university notes it will be help
Typology: Lecture notes
1 / 38
This page cannot be seen from the preview
Don't miss anything!
Atmega 328 Pinout
AVR Architecture
int main ( ) { byte counter; while (1){ counter++; } return 0; }
TERMINOLOGY
𝑇 𝐷
A FLIP-FLOP AND A COUNTER
(^) a collection of flip-flops with the clock input of stage n connected to the output of stage n -
A generic timer/counter
Timer Terms
Timer Modes (Wave Generation Modes)
Phase correct mode 0xFF TCNT 0 TOV time
CTC mode TCNT 0 OCF0 OCF0 OCF time
OCR0A
0xFF
Timing with Prescaling Prescaling f/
Timer Registers in AVR
Timer0 Registers FOC 0 A FOC 0 B - - WGM 02 CS 02 CS 01 CS 00 TCCR 0 B
TIMSK 0 :
TIMSK 1 : (^) ICIE
TIMSK 2 :
Timer FOC 0 A FOC 0 B - - WGM 02 CS 02 CS 01 CS 00 TCCR 0 B
0 0 0 Normal 255 0 0 1 Phase correct PWM 255 0 1 0 CTC (Clear Timer on Compare Match) OCR0A 0 1 1 Fast PWM 255 1 0 0 Reserved - 1 0 1 Phase correct PWM OCR0A 1 1 0 Reserved - 1 1 1 Fast PWM OCR0A