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 support@ccsinfo.com

Sounds Generation .

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







Sounds Generation .
PostPosted: Tue Feb 04, 2003 9:18 am     Reply with quote

Hi All !

I am just starting use CCS C Compiler and i took
a look samples routines.
Does anybody have some idea to generate sounds
using it?
I am developing a baterry charger using switched
in high frequency rectifier and i'd like to put some beeps
alarms with it .
Any idea will be very appreciated and will be my pleasure to show in here the complete program for discussion.

Thnx !
___________________________
This message was ported from CCS's old forum
Original Post ID: 11267
Shane Rowell
Guest







Re: Sounds Generation .
PostPosted: Tue Feb 04, 2003 10:38 am     Reply with quote

If you look at the ex_tones.c and tones.c files you will find one way to implement sound. These two files are used to play the Happy Birthday song. Just before Christmas I programmed a 16F877, attached a piezo (no built in oscillator), and was listening to an old favorite.
You can also use one of the PWM outputs and play with the period and duty if you just want to find a sutable tone for an alarm.

Good luck,

Shane

:=
:= Hi All !
:=
:= I am just starting use CCS C Compiler and i took
:=a look samples routines.
:= Does anybody have some idea to generate sounds
:= using it?
:= I am developing a baterry charger using switched
:= in high frequency rectifier and i'd like to put some beeps
:= alarms with it .
:= Any idea will be very appreciated and will be my pleasure to show in here the complete program for discussion.
:=
:= Thnx !
___________________________
This message was ported from CCS's old forum
Original Post ID: 11269
Harold



Joined: 16 Feb 2004
Posts: 1

View user's profile Send private message

Re: Sounds Generation .
PostPosted: Mon Feb 16, 2004 9:05 am     Reply with quote

[quote="Shane Rowell"]
<<I programmed a 16F877, attached a piezo (no built in oscillator), and was listening to an old favorite. You can also use one of the PWM outputs ..

Where did you attach the piezo speaker? Ex_tones.c says:

Connect the positive wire of the speaker to pin 47 (B0)
Connect the negative wire of the speaker to pin 27 (Gnd)

On my just purchased 16F877a prototype board, I see no such pin in the terminal block or elsewhere.



Thanks
smrowell



Joined: 16 Feb 2004
Posts: 3

View user's profile Send private message

PostPosted: Mon Feb 16, 2004 6:29 pm     Reply with quote

I just used a 16F877 in a 40 pin dip package on a breadboard with a 40MHz clock. Pin B0 is the lowest bit of Port B.

If you read the code you can change which pins are used. I do not recommend using this for anything other than playing around. if you want to make a product sound, add a driver transistor for the piezo.

Shane
neil



Joined: 08 Sep 2003
Posts: 128

View user's profile Send private message

40MHz?!
PostPosted: Tue Feb 17, 2004 5:49 am     Reply with quote

A 16F877 at 40MHz? Are you sure? They are only supposed to operate at 20 max! Did you mean 4MHz?
smrowell



Joined: 16 Feb 2004
Posts: 3

View user's profile Send private message

PostPosted: Tue Feb 17, 2004 9:55 am     Reply with quote

Thanks Neil,

Sorry, it should say 20MHz. So many parts, so many speeds.

Shane
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