CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Picedem2 plus and buzzer

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Agios



Joined: 28 Jan 2006
Posts: 8
Location: Brighton

View user's profile Send private message

Picedem2 plus and buzzer
PostPosted: Mon Feb 27, 2006 5:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Feb 27, 2006 7:09 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Mon Feb 27, 2006 9:22 am     Reply with quote

In the code library is some picdem2 buzzer code that plays chrismas tunes.

It could get you started.
http://www.ccsinfo.com/forum/viewtopic.php?t=22010&highlight=music
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group