Line 11: Line 11:
  
  
=Hookup=
+
=Objective=
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.
+
After blinking the leds and Controlling tnem with switches, its time to make some noise using the buzzer. In the first part of the tutorial, we will beep the buzzer every 2secs. At the end we will control the buzzer using a switch.  
==Type 1:Breadboard with Explore AVR 40 Pin Breakout Board with Atmega32==
+
===Components Used===
+
 
+
{| class="wikitable"
+
|-
+
| 1||
+
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/avr-mcu-breakout/1-dsc02958.jpg" width="300 px"></html>
+
 
+
|| AVR 40 pin breakout board with Atmega32<br />
+
[https://www.exploreembedded.com/product/AVR%2040%20Pin%20Breakout%20Board%20with%20Atmega32 Click here to buy from our store]
+
|-
+
|2||
+
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/breadboard-large/breadboard_large.jpg" width="300 px"></html>
+
 
+
|| Breadboard <br />
+
[https://www.exploreembedded.com/product/Large%20Breadboard Click here to buy from our store]
+
|-
+
| 3||
+
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/male-to-male-jumper-wires-pack-of-40/1-dsc04497.jpg" width="300 px"></html>
+
 
+
|| Male to Male Jumper Wires <br />
+
[https://www.exploreembedded.com/product/Male%20to%20Male%20Jumper%20Wires%20-%20Pack%20of%2040 Click here to buy from our store]
+
|-
+
 
+
| 4||
+
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/bc547/bc547.jpg" width="300 px"></html>
+
|| Transistor - BC547 <br />
+
[ Click here to buy from our store]
+
|-
+
 
+
| 5||
+
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/buzzer/buzzer.jpg" width="300 px"></html>
+
|| Buzzer <br />
+
[ Click here to buy from our store]
+
|-
+
 
+
| 6||
+
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/resistor/3_resistors.jpg" width="300 px"></html>
+
|| Resistor <br />
+
[https://www.exploreembedded.com/product/10K%20ohm%20Resistor Click here to buy from our store]
+
|}
+
 
+
==Wiring diagram==
+
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/fritzing-tutorials_de69ccc2/buzzer_breadboard_bb.png" width="670 px"></html>
+
 
+
==Type 2:Using Explore Ultra AVR Dev Kit==
+
===Components Used===
+
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.
+
  
 +
=Register Configuration =
 +
Please refer the below tutorial for basics of GPIO register configuration.
 
<html>
 
<html>
 
<ul>
 
<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/wiki/2._AVR_I/O_Register_Configuration">AVR I/O Register Configuration
<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>
 
</a>
 
</ul>
 
</ul>
 
</html>
 
</html>
  
 +
==Wiring diagram==
 
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/fritzing-tutorials_de69ccc2/buzzer_bb.png" width="670 px"></html>
 
<html><img src ="https://www.exploreembedded.com/blog/wp-content/uploads/img-collections/fritzing-tutorials_de69ccc2/buzzer_bb.png" width="670 px"></html>
  

Revision as of 16:29, 4 February 2016

Guru (talk) 20:00, 17 November 2015 (IST)


The Rock (1996)


Objective

After blinking the leds and Controlling tnem with switches, its time to make some noise using the buzzer. In the first part of the tutorial, we will beep the buzzer every 2secs. At the end we will control the buzzer using a switch.

Register Configuration

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

Wiring diagram


Code

 /*-----------------------------------------------------------------------------
                 Program to demonstrate Buzzer
  -----------------------------------------------------------------------------
 
note: Connect Buzzer on PORTB.0
 
------------------------------------------------------------------------------*/
 
 
/* htc.h contains the definition of all ports and SFRs */
#include <avr\io.h>
#include "stdutils.h"
#include "delay.h" //User defined library which contains the delay routine
 
/* start the main program */
void main() 
{
  /*Configure PORTB.0 port as output */
 
   DDRB= 0x01;
 
 
  while(1)
    {
 
	 /* Turn On buzzer and wait for 3 second */ 
 
	   PORTB = 0x01;
 
	   DELAY_sec(3);
 
	  /* Turn Off buzzer and wait for 3 second */ 
 
	   PORTB = 0x00;
 
	   DELAY_sec(3);
 
 
		  }
  }

Video Tutorial