View previous topic :: View next topic |
Author |
Message |
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
CCP Help needed |
Posted: Wed Nov 04, 2009 4:25 pm |
|
|
How can I measure distance (ultrasonic distance meter) using the
capture feature of PIC ? I am using pin C1 of PIC18F2550 to generate
12us freq pulse and C1 (CCP) is used to capture reflected signal.
Anyone can help me please.
Its urgent because this is my 5th semester main project. I have
constructed all hardware part, but my programs are not working
correctly. Hardware works fine, I tested it with a 40khz signal.
Please help me... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Nov 04, 2009 4:42 pm |
|
|
Give us more information. How long is the expected time from the
trigger pulse to the reception of the reflected pulse ?
Quote: | ultrasonic distance meter |
Post the manufacturer and model number of the device.
We are not mind readers. |
|
|
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
|
Posted: Wed Nov 04, 2009 5:14 pm |
|
|
This is the circuit
but i were changed the mc to pic18f2550 (with 20mhz xtal) and LCD display used instead of 7-segment +
C1 - 12us signal
C2 - Capture
I don't know the manufacturer of ultrasonic modules(rx and tx).
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Nov 04, 2009 5:33 pm |
|
|
Quote: |
How long is the expected time from the trigger pulse to the reception of
the reflected pulse ? |
You didn't answer this question. |
|
|
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
|
Posted: Wed Nov 04, 2009 5:50 pm |
|
|
Sorry.
From the circuit developer's site i got the following details.
|
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Wed Nov 04, 2009 11:58 pm |
|
|
Sonar!!
I have yet to do a sonar project. :D they look like fun!
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
Jerson
Joined: 31 Jul 2009 Posts: 125 Location: Bombay, India
|
|
Posted: Thu Nov 05, 2009 12:53 am |
|
|
To the best of my knowledge, you do not need the CCP module to capture the incoming reflection. You just need to know how much time later the echo is captured. So, you need to use a timer. I have worked on a sonar and know that the transducers need to operate at their optimal frequency. You may use a firmware loop to generate the sounding pulse. Later on, you need to check the CCP line for a change of level indicating echo. _________________ Regards
Jerson Fernandes |
|
|
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
|
Posted: Thu Nov 05, 2009 2:05 am |
|
|
Can you post code for the above circuit..
Thanks |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu Nov 05, 2009 2:38 am |
|
|
I wonder what's your original project contribution, you copied the circuit and are asking to copy the code now.
Try to imagine a job interview, when they ask you, what you did in your final years project (I always would ask).
Asking for help is another thing. But you should do your part of the work first. |
|
|
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
|
Posted: Thu Nov 05, 2009 3:00 am |
|
|
Our group is trying to do a simple ROBOT, as a part of this machine we need sensors like range meter,temp. senor,light intensity sensor.Interfacing of stepper motor and wireless link + usb interfacing for transmitter were done.But our code for range meter(i got the ckt from net) is not working.So i am requesting experts to help me.....
Thanks |
|
|
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
|
Posted: Thu Nov 05, 2009 3:31 am |
|
|
Here is my CIRCUIT i am doing this not just for time pass, i really need help because it is a part of my sem. project......
|
|
|
Jerson
Joined: 31 Jul 2009 Posts: 125 Location: Bombay, India
|
|
Posted: Thu Nov 05, 2009 4:50 am |
|
|
Wouldn't it be better to look for the HEX file at the author's site?
I'm sure, no 'expert' here would be willing to spare time from their paid work to code for your circuit. If you do some coding yourself OR pay for your coding, there may be people who might help you. I myself, do not encourage/indulge in coding for students since it defeats the purpose of learning by doing college projects. _________________ Regards
Jerson Fernandes |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Thu Nov 05, 2009 4:52 am |
|
|
Range meter project is simple.
The theory goes like that: You send the "ping" and you listen then for the "pong". Between that you measure the time. Distance is then calculated from known speed of sound in the air and time.
Now the question is: Did you ever write an CCS program (or any C) yet? |
|
|
anandpv2009
Joined: 26 Jul 2009 Posts: 31
|
|
Posted: Thu Nov 05, 2009 6:33 am |
|
|
Ok.. I will do it myself, and thank u for CCS members advice....
''I will always help members if I know th code. But...'' |
|
|
bungee-
Joined: 27 Jun 2007 Posts: 206
|
|
Posted: Thu Nov 05, 2009 7:02 am |
|
|
This forum is primarily intended for help with coding. So if you have code and you get strange results, or if you don't know how to do some part you are welcome we'll be happy to help. But if you expect that someone will write the code for you..... |
|
|
|