(44 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[User:Sandeep|Sandeep]] ([[User talk:Sandeep|talk]]) 09:51, 5 November 2015 (IST)
+
 
----
+
 
[[Category:AVR Tutorials]]
 
[[Category:AVR Tutorials]]
This is the first tutorial with AVR where we will get hands on! Let's do a 'hello world' for Embedded. We will interface a simple LED with one of the port pins. The LED as might know emits light when current is passed through it. It could blow up if we pass more current ( >20mA depending on make and type), hence we put a current limiting resistor. Usually 220, 470 and 1K ohm resistors are found. You can use any of these, it should not be an issue.  
+
[[Category:Explore Ultra AVR Dev Kit]]
 +
 
 +
This is the first tutorial with AVR where we will get hands on. We will interface a simple LED with one of the port pins. The LED as might know emits light when current is passed through it. It could blow up if we pass more current ( >20mA depending on make and type), hence we put a current limiting resistor. Usually 220, 470 and 1K ohm resistors are found. You can use any of these, it should not be an issue.  
 
Well instead of a single one, we can as-well connect a bunch of these to port and blink them.  
 
Well instead of a single one, we can as-well connect a bunch of these to port and blink them.  
  
=Hookup=
 
You may look this up with the simple breadboard as shown in section below or you could use the Ultra AVR dev kit if do not wish to jumble with wires and resistors.
 
==Breadboard with Explore AVR 40 Pin Breakout Board with Atmega32==
 
[[File:Blink breadboard bb.png|x360px|center]]
 
===Components Used===
 
  
  
==With Explore Ultra AVR Dev Kit==
+
=Register Configuration =
If you're into learning Embedded C programming quickly and also want to do lot of hardware interfaces, the Ultra AVR dev kit is great option.
+
Please refer the below tutorial for basics of GPIO register configuration.
[[File:Blink bb.png|x360px|center]]
+
<html>
===Components Used===
+
<ul>
 +
<a href="https://www.exploreembedded.com/wiki/2._AVR_I/O_Register_Configuration">AVR I/O Register Configuration
 +
</a>
 +
</ul>
 +
</html>
 +
 
 +
=Code=
 +
Below points needs to be considered for this example.
 +
* Include the io.h file as it has the definitions for all the PORT registers.
 +
* Include delay.h file to use the delay functions.
 +
* Configure the PORT as Output before writing any data to PORT pins.
 +
 
 +
==Blink Leds==
 +
<html>
 +
<script src="https://gist.github.com/SaheblalBagwan/a671ac5b9c722f350a9d.js"></script>
 +
</html>
 +
 
 +
=Led Blinking Wiring Diagram=
 +
[[File:Blink bb.png|x480px|center]]
 +
 
 +
 
 +
 
 +
=Explore Ultra AVR Dev Kit=
 +
The Explore Ultra AVR Kit comes with all the things required, not just for this experiment but for the entire series. And even if you think of migrating to PIC or Arduino, you'll have breakout boards that fit on to this, hence we believe it is a great investment for learning hands on Embedded Systems. The kit is fully open source, you may use the schematics, the design files and all of the source code and build something cool on your own. And when you do that do not forget to share with us what you've done. We would be happy to see you building something cool.
 +
 
 +
[[File:0Blinky AVR.gif|none]]
 +
<html>
 +
<ul>
 +
<li>Explore Ultra AVR Dev Kit: <a https://www.exploreembedded.com/product/Explore%20Ultra%20AVR%20Dev%20Kit> Buy from EE Store </a></li>
 +
<a href="https://www.exploreembedded.com/product/Explore%20Ultra%20AVR%20Dev%20Kit">
 +
<img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/explore-avr-pic-kit/1-dsc03897.jpg" width="480 px">
 +
</a>
 +
</ul>
 +
</html>
 +
 
 +
=Video Tutorial=
 +
For those of you, who would like to watch instead of read we have made a video with all the gyan.
 +
<br>
 
{{#ev:youtubehd|-lNAmSNV2-Q|640}}
 
{{#ev:youtubehd|-lNAmSNV2-Q|640}}
[[File:Schematic AVR Interface LED.JPG|680px]]
+
 
'''Code and Explanation will be updated soon..'''
+
 
 +
= Downloads=
 +
Download the complete project folder from the below link:  
 +
https://github.com/ExploreEmbedded/ATmega32_ExploreUltraAvrDevKit/archive/master.zip<br>
 +
 
 +
 
 +
 
 +
Have a opinion, suggestion , question or feedback about the article let it out here!
 +
{{DISQUS}}

Latest revision as of 11:18, 19 April 2016


This is the first tutorial with AVR where we will get hands on. We will interface a simple LED with one of the port pins. The LED as might know emits light when current is passed through it. It could blow up if we pass more current ( >20mA depending on make and type), hence we put a current limiting resistor. Usually 220, 470 and 1K ohm resistors are found. You can use any of these, it should not be an issue. Well instead of a single one, we can as-well connect a bunch of these to port and blink them.


Register Configuration

Please refer the below tutorial for basics of GPIO register configuration.

Code

Below points needs to be considered for this example.

  • Include the io.h file as it has the definitions for all the PORT registers.
  • Include delay.h file to use the delay functions.
  • Configure the PORT as Output before writing any data to PORT pins.

Blink Leds

Led Blinking Wiring Diagram

Blink bb.png


Explore Ultra AVR Dev Kit

The Explore Ultra AVR Kit comes with all the things required, not just for this experiment but for the entire series. And even if you think of migrating to PIC or Arduino, you'll have breakout boards that fit on to this, hence we believe it is a great investment for learning hands on Embedded Systems. The kit is fully open source, you may use the schematics, the design files and all of the source code and build something cool on your own. And when you do that do not forget to share with us what you've done. We would be happy to see you building something cool.

0Blinky AVR.gif

Video Tutorial

For those of you, who would like to watch instead of read we have made a video with all the gyan.


Downloads

Download the complete project folder from the below link: https://github.com/ExploreEmbedded/ATmega32_ExploreUltraAvrDevKit/archive/master.zip


Have a opinion, suggestion , question or feedback about the article let it out here!