Show Menu
Cheatography

ATmega16 Cheat Sheet (DRAFT) by

All improtant c instructions for Atmel's ATmega16

This is a draft cheat sheet. It is a work in progress and is not finished yet.

AVR Bitman­ipu­lation

setting some bits
PORTD |= (1 << PD1) | (1 << PD2)
clearing some bits
PORTD &= ~((1 << PD1) | (1 << PD2))
toggling some bits
PORTD ^= (1 << PD1) | (1 << PD2)
checking a Bit
PORTD & ((1 << PD1) | (1 << PD2))

Timer1

16 bit Timer/­Counter
Timer/­Cou­nter1 Control Register A
TCCR1A
Timer/­Cou­nter1 Control Register B
TCCR1B
Timer/­Cou­nter1
TCNT1
Output Compare Register 1 A
OCR1A
Output Compare Register 1 B
OCR1B
Input Capture Register 1
ICR1
Timer/­Counter Interrupt Mask Register
TIMSK