Beep buzzer twice

Status
Not open for further replies.

adrianvon

Member
Hi all,

I connected a buzzer to a PIC microcontroller. Now i want to make it beep for approx 3sec, stop for 3 sec and then beep again for 3sec.

Now my problem is that when i decrement three registers, the buzzer is beeping for approx 12sec and when i decrement two registers the buzzer is beeping for approx 0.1sec. How can i make it beep for approx 3 sec??

Below is the coding that i am using:


Thanks is advance.
 
Instead of clearing the registers, place values in them.

If you reduce reg4 to a 1/4 of what it is (64 for an 8-bit PIC; 16384 for a 16-bit PIC), you will get a quarter of your current delay.

So replace 'CLRF REG4' with:

MOVLW 16384
MOVWF REG4

and that should give you a quarter of your current delay.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…