m (Sandeep moved page 3.AVR Programming in C to Basics of AVR 'C')
Line 1: Line 1:
 
[[Category:AVR Tutorials]]
 
[[Category:AVR Tutorials]]
Let us look at the basics of 'C' for programming AVR Micrcontrollers in this tutorial. Simple stuff like setting and clearing bits is important to any project you do.  
+
Let us look at the basics of 'C' for programming AVR Micrcontrollers in this tutorial. Simple stuff like setting and clearing bits is important to any project you do. <br/>
 +
It is often required to set, clear, toggle and check bit status of a Register without '''affecting any other bits.''' Also it is important to do in a way that is compiler independent and code can be ported without modifications.
 +
 
 
=Setting a bit=
 
=Setting a bit=
 
=Clearing a bit=
 
=Clearing a bit=
 
=Checking a bit=
 
=Checking a bit=
 
=Toggling a bit=
 
=Toggling a bit=

Revision as of 09:27, 23 March 2016

Let us look at the basics of 'C' for programming AVR Micrcontrollers in this tutorial. Simple stuff like setting and clearing bits is important to any project you do.
It is often required to set, clear, toggle and check bit status of a Register without affecting any other bits. Also it is important to do in a way that is compiler independent and code can be ported without modifications.

Setting a bit

Clearing a bit

Checking a bit

Toggling a bit