Musical DoorBell with PIC16F84A

Microcontroller Topics

What do you think about this example?

Poll ended at Fri Apr 23, 2010 5:00 pm

Very good
10
83%
Good
2
17%
Bad
0
No votes
Very bad
0
No votes
 
Total votes: 12
User avatar
Shane
Captain
Captain
Posts: 226
Joined: Sun Jul 19, 2009 9:59 pm
Location: Jönköping, Sweden

Re: Musical DoorBell with PIC16F84A

Post by Shane » Fri May 27, 2011 10:13 pm

Great. Make sure you have grounded one end of the speaker and the other end only connected to RB0. Remove any coding that involve RB1, RB2 and RB3. Hope that will help.
DeepakPatil23
Sergeant
Sergeant
Posts: 20
Joined: Mon May 23, 2011 7:16 pm

Re: Musical DoorBell with PIC16F84A

Post by DeepakPatil23 » Tue May 31, 2011 4:05 pm

Hi Shane,

I connect components as per given circuit(cd1.PNG). while compiling the project it gives the error for delay10ms(); and Delay_us(t1); not found symbol. I am using HiTECH C compiler. i search for delay.h or timer.h but not found.
Any idea whats the issue :?: :?:
:?
User avatar
Shane
Captain
Captain
Posts: 226
Joined: Sun Jul 19, 2009 9:59 pm
Location: Jönköping, Sweden

Re: Musical DoorBell with PIC16F84A

Post by Shane » Tue May 31, 2011 6:34 pm

  1. Add the 3 files in the attachment to your project.
  2. Under delay.h, on the first line make sure you put the right setting for PIC_CLK (It is defined for a 4MHz OSC at the moment)
  3. Now you can use DelayBigUs(t1); instead of Delay_us(t1); and DelayBigMs(10); instead of delay10ms();
Delay.zip
(4.44 KiB) Downloaded 368 times
DeepakPatil23
Sergeant
Sergeant
Posts: 20
Joined: Mon May 23, 2011 7:16 pm

Re: Musical DoorBell with PIC16F84A

Post by DeepakPatil23 » Mon Jul 04, 2011 7:01 pm

Hi,

I made the Do Musical DoorBell with PIC 16F628 but why to waste this 18 pin PIC for just one output line so I buy 8 pin PIC 12F629 i change program as per 8 pin pic with same crystal and also code also same just changed the port address GPIO but it creates a humming sound not exactly the way it should work.

what could be the reason?
User avatar
Shane
Captain
Captain
Posts: 226
Joined: Sun Jul 19, 2009 9:59 pm
Location: Jönköping, Sweden

Re: Musical DoorBell with PIC16F84A

Post by Shane » Mon Jul 04, 2011 10:11 pm

You are correct. It is always good to find the cheapest micro that satisfy the minimum requirements. However when you are learning, it is very good to work with a micro with good help. PIC 16F877A is one of them and I remember I told you this before.

Have you considered the oscillator in PIC12F629?
PIC12F629 has a 4MHz internal oscillator. However you could connect an external oscillator if you want but since it has very few pins, external oscillator is not always used. Following is a circuit with external oscillator.
pic12f629.gif
pic12f629.gif (2.61 KiB) Viewed 7990 times
The datasheet says you can go up to 20MHz.

Here we address your issue. Have you changed the delay.h based on the frequency of your oscillator? You need to change line #define PIC_CLK 4000000 //4Mhz according to your oscillator frequency.
DeepakPatil23
Sergeant
Sergeant
Posts: 20
Joined: Mon May 23, 2011 7:16 pm

Re: Musical DoorBell with PIC16F84A

Post by DeepakPatil23 » Tue Jul 05, 2011 4:51 pm

Hi,

Yes, you are correct i forgot to change there I use 20MHz so i changed the value as per 20MHz = 20000000
But still the same humming sound coming. So i Tried with the one PIC Simulator which i download from Microchip site. and checked then i realized :idea: that Timer 0 is not get started timer1 is only activated as i use Timer interrupt delay.

Even if i use the the delay.h and delay.c then the delay_us is not activated at all. it moves to next code line where sound bit gets off.
:?: :geek:
DeepakPatil23
Sergeant
Sergeant
Posts: 20
Joined: Mon May 23, 2011 7:16 pm

Re: Musical DoorBell with PIC16F84A

Post by DeepakPatil23 » Tue Nov 08, 2011 7:03 pm

SukhdeepMankoo wrote:First all you need to read wave file. after reading the wave file, you will get the data. send that data to pwm register or to DAC. will be get the sound on speaker. Note down the link, which tell you the wave file format.

https://ccrma.stanford.edu/courses/422/ ... aveFormat/


read the format and make program to get the information(data) in wave file.

As you suggested i done this take data from the wave file. but i have done for a particular wav file type its not dynamic but still its ok. now what to do next?? :geek: :idea:
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: Musical DoorBell with PIC16F84A

Post by SemiconductorCat » Sun Nov 13, 2011 10:01 pm

Rksk wrote:you are Welcome to robot.lk.

it seems you have to amplify the out put of PIC.

Below cricuit is very easy to build. tryout it.
lm386amp.gif
I'm unable to covert this ASM code to C, because I'm busy with my studies.

[ Post made via Mobile Device ] Image

are you sure on this circuit configuration ?
I have never seen this open loop sound pre amplifier configuration like this before.
User avatar
Rksk
Major
Major
Posts: 730
Joined: Thu Jan 07, 2010 4:19 pm
Location: Rathnapura, Sri Lanka

Re: Musical DoorBell with PIC16F84A

Post by Rksk » Sun Nov 13, 2011 11:19 pm

SandunDhammikaPerera wrote:
Rksk wrote:you are Welcome to robot.lk.

it seems you have to amplify the out put of PIC.

Below cricuit is very easy to build. tryout it.
lm386amp.gif
I'm unable to covert this ASM code to C, because I'm busy with my studies.

[ Post made via Mobile Device ] Image

are you sure on this circuit configuration ?
I have never seen this open loop sound pre amplifier configuration like this before.
Yes it's a problem. (I didn't see the circuit carefully when posting)

But google for images "LM 386" & see.
DeepakPatil23
Sergeant
Sergeant
Posts: 20
Joined: Mon May 23, 2011 7:16 pm

Re: Musical DoorBell with PIC16F84A

Post by DeepakPatil23 » Mon Nov 14, 2011 3:17 pm

Rksk wrote:
SandunDhammikaPerera wrote:
Rksk wrote:you are Welcome to robot.lk.

it seems you have to amplify the out put of PIC.

Below cricuit is very easy to build. tryout it.
lm386amp.gif
I'm unable to covert this ASM code to C, because I'm busy with my studies.

[ Post made via Mobile Device ] Image

are you sure on this circuit configuration ?
I have never seen this open loop sound pre amplifier configuration like this before.
Yes it's a problem. (I didn't see the circuit carefully when posting)

But google for images "LM 386" & see.
Ohhh... I prepaired this circuit as per shown. and sound not get amplified as i thought. :? :o :o its just a little bit get amplified. as i mention i m beginner. can you suggest me :idea: for that. and how you locate that or come to know that its open loop pre amplifier. please help me. thank you. 8-)
Post Reply

Return to “Microcontrollers”