View previous topic :: View next topic |
Author |
Message |
Agios
Joined: 28 Jan 2006 Posts: 8 Location: Brighton
|
Picedem2 plus and buzzer |
Posted: Mon Feb 27, 2006 5:24 am |
|
|
Hi everyone,
A question which some of you might find it very simple to answer. I am currently playing with my picdem2 peripherals and what I want is to operate the buzzer for 2seconds and then turn it off. I HAVE jumper 9 connected and all I can hear when RC2 goes high is a !click! and after 2 seconds another !click!. Am I doing something wrong?? Given the circuitry in picdem2 all it is required is just a logic1(5V) of logic0(0V) to operate the buzzer. Any suggestions will be really helpfull!!
OOOOHH and something else... I know that some of you get really ungry when they see dealy_ms() function, can someone suggest an easy way of using PIC timers for simple delays; (From μsecs to secs).
Awaiting suggestions
Agios
Code: |
void main (void){
lcd_init();
printf(lcd_putc,"Hi ");
lcd_gotoxy(1,2);
printf(lcd_putc,"There");
output_bit( PIN_C2, 1);
delay_ms(2000);
output_bit( PIN_C2, 0);
while(1);
}
|
|
|
|
Paolino
Joined: 19 Jan 2004 Posts: 42
|
|
Posted: Mon Feb 27, 2006 7:09 am |
|
|
It seems that the buzzer must be driven with a PWM signal, since it has not an internal oscillator itself. I do not have right now the schematich of PICEDEM 2 PLUS, but I seem to remeber that the buzzer is connected (via J9) to CCP/PWM ports of the sockets.
I suggest you to setup the desired PWM and drive it to the buzzer.
Best regards.
Paolo. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
|
|