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

CCP Help needed
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
anandpv2009



Joined: 26 Jul 2009
Posts: 31

View user's profile Send private message

CCP Help needed
PostPosted: Wed Nov 04, 2009 4:25 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Nov 04, 2009 4:42 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Nov 04, 2009 5:14 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Nov 04, 2009 5:33 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Nov 04, 2009 5:50 pm     Reply with quote

Sorry.

From the circuit developer's site i got the following details.

bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Wed Nov 04, 2009 11:58 pm     Reply with quote

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

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

PostPosted: Thu Nov 05, 2009 12:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 2:05 am     Reply with quote

Can you post code for the above circuit..



Thanks
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 2:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 3:00 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 3:31 am     Reply with quote

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

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

PostPosted: Thu Nov 05, 2009 4:50 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 4:52 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 6:33 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 7:02 am     Reply with quote

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..... Rolling Eyes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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