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

Check if PWM is connected

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



Joined: 27 May 2010
Posts: 52

View user's profile Send private message

Check if PWM is connected
PostPosted: Wed Aug 11, 2010 10:49 am     Reply with quote

I am writing code for a circuit that may or may not have a position transducer attached (this will be optional). The transducer sends a pwm signal that I read on the CCP module.

How can I tell if it's attached? The only thing I can come up with is some kind of timeout on the CCP module. If the timeout runs out, I know the PWM isn't attached and I can skip the reads from there on. I can't figure out a way to have the CCP timeout and just move on to the next instruction. I'm also open to other suggestions on checking if its attached.

This is on a PIC16F88 btw. Thanks in advance!
jbmiller



Joined: 07 Oct 2006
Posts: 73
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Aug 11, 2010 12:03 pm     Reply with quote

You could monitor the current that the transducer draws. Obviously, if the transducer is plugged in, you'll get a reading of 'I'm here', providing the transducer gets its power from the same board that the PIC is on.

Or you could have an I/O pin dedicated to a loopback in the transducer's connector to confirm the unit is plugged in.

The problem with monitoring the PWM O/P is that the transducer might be in idle, in setup, offline, broken?, etc. and not give you the reading you expect.
skoberlink



Joined: 27 May 2010
Posts: 52

View user's profile Send private message

PostPosted: Thu Aug 12, 2010 7:55 am     Reply with quote

jbmiller wrote:

The problem with monitoring the PWM O/P is that the transducer might be in idle, in setup, offline, broken?, etc. and not give you the reading you expect.


You're exactly right. Therein lies my problem. Laughing Ah well, those are good ideas and I've got a few other things to try as well. Thanks!
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