View previous topic :: View next topic |
Author |
Message |
skoberlink
Joined: 27 May 2010 Posts: 52
|
Check if PWM is connected |
Posted: Wed Aug 11, 2010 10:49 am |
|
|
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
|
|
Posted: Wed Aug 11, 2010 12:03 pm |
|
|
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
|
|
Posted: Thu Aug 12, 2010 7:55 am |
|
|
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. Ah well, those are good ideas and I've got a few other things to try as well. Thanks! |
|
|
|