Atmega128a-au Buzzer Driver

Source: Internet
Author: User

1. First look at schematic diagram

The other end of the Beep-m connection is connected to the Mega128a-au PC1

In this way, we give PC1 output low time transistor conduction, buzzer rang, PC1 output high, transistor cutoff, buzzer does not ring.
The current at both ends of the R501 is measured at 20mA at the on-conduction
At 3V voltage, the output current of the I/O pins is typically 10mA
The manual DC characteristics has the following description:
Although each I/O port can sink more than the test conditions (ma at VCC = 5V, ten ma at VCC = 3V)

2. Driver writing
Main support for buzzer opening, closing, and toggle

void pdd_beeper_on (void) {    set_bit (DDRC, PC1);     void Pdd_beeper_off (void) {    set_bit (DDRC, PC1);     void pdd_beeper_toggle (void) {    set_bit (DDRC, PC1);    Flp_bit (PORTC, PC1);}

Atmega128a-au Buzzer Driver

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.