Musical DoorBell with PIC16F84A
Re: Musical DoorBell with PIC16F84A
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.
-
- Sergeant
- Posts: 20
- Joined: Mon May 23, 2011 7:16 pm
Re: Musical DoorBell with PIC16F84A
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
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
Re: Musical DoorBell with PIC16F84A
- Add the 3 files in the attachment to your project.
- 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)
- Now you can use DelayBigUs(t1); instead of Delay_us(t1); and DelayBigMs(10); instead of delay10ms();
-
- Sergeant
- Posts: 20
- Joined: Mon May 23, 2011 7:16 pm
Re: Musical DoorBell with PIC16F84A
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?
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?
Re: Musical DoorBell with PIC16F84A
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. 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.
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. 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.
-
- Sergeant
- Posts: 20
- Joined: Mon May 23, 2011 7:16 pm
Re: Musical DoorBell with PIC16F84A
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 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.
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 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.
-
- Sergeant
- Posts: 20
- Joined: Mon May 23, 2011 7:16 pm
Re: Musical DoorBell with PIC16F84A
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??
- SemiconductorCat
- Major
- Posts: 455
- Joined: Mon Aug 22, 2011 8:42 pm
- Location: currently in hyperspace
Re: Musical DoorBell with PIC16F84A
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. I'm unable to covert this ASM code to C, because I'm busy with my studies.
[ Post made via Mobile Device ]
are you sure on this circuit configuration ?
I have never seen this open loop sound pre amplifier configuration like this before.
Re: Musical DoorBell with PIC16F84A
Yes it's a problem. (I didn't see the circuit carefully when posting)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. I'm unable to covert this ASM code to C, because I'm busy with my studies.
[ Post made via Mobile Device ]
are you sure on this circuit configuration ?
I have never seen this open loop sound pre amplifier configuration like this before.
But google for images "LM 386" & see.
-
- Sergeant
- Posts: 20
- Joined: Mon May 23, 2011 7:16 pm
Re: Musical DoorBell with PIC16F84A
Ohhh... I prepaired this circuit as per shown. and sound not get amplified as i thought. its just a little bit get amplified. as i mention i m beginner. can you suggest me for that. and how you locate that or come to know that its open loop pre amplifier. please help me. thank you.Rksk wrote:Yes it's a problem. (I didn't see the circuit carefully when posting)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. I'm unable to covert this ASM code to C, because I'm busy with my studies.
[ Post made via Mobile Device ]
are you sure on this circuit configuration ?
I have never seen this open loop sound pre amplifier configuration like this before.
But google for images "LM 386" & see.