At 10:33 AM 6/29/2008, you wrote: >Hi all. > >Attached is the schematic for my current project. It is a wireless >garage door monitor. It uses two magnetic switches to monitor two >garage doors, and wirelessly transmits the door state and battery >state to a receiver. > >The basic concept is simple. The PIC puts all pins as input except >AN0 which is used to monitor the battery health. It then sleeps for >about 2.5 seconds, wakes up, checks the battery state, checks the >door states, and then activates the transmitter, and transmits a 24 >bit data stream (ID, state, checksum). > >The problem is that, after a number of hours (about 5) of >continuously correct operation, it starts transmitting that the one >door is 'open'. > >First though, some details. > >The batteries are 2xAA Lithium 1.5V >IC1 is a PIC12F675 with MCLR off (pin is used as digital input). The >PIC is the DIP version and is socketed, pulled for programming, and >then re-socketed. No need for ICSP. >U1 is a 1.25V reference - REF3312 from Texas Instruments - it has a >5uA quiescent current. >U2 is a TXM-418-LR from Linx which has 5nA drain when /PDN is pulled low. > >The momentary switch is only used to generate a new ID for the >transmitter. If the switch is closed then the unit powers up >(resets), the PIC will simply run a timer until the button is >released. Whatever the value in the (8-bit) timer is when the button >is released will become the devices new ID. The button will do >nothing else while the system operates. > >The door that is indicated to be open is always the one that is >sensed through GP1 (pin 6). The door sensed through GP3 is never >sensed wrong (yet). > >When the system runs correctly, I measure the following values at >the various pins (using a DMM all measurements on 2000mV range >except pin 1 on 20V range, all measurements to ground): >1 3.29 >2 0.000 >3 0.000 >4 0.000 >5 0.002 >6 0.010 and 3.28 with the magnetic switch closed. >7 1.249 >8 0.000 > > >When the system is 'broken', I have the following measurements: >1 3.31 >2 0.000 >3 0.000 >4 0.000 >5 0.000 >6 1.250 and 1.318 with the magnetic switch 'closed' >7 1.249 >8 0.000 > >The actual values for the 'broken' situation are suspiciously >similar between pin 6 and 7... but, it is weird that it rises to >1.318V when the switch is closed..... > >I am at a loss as to what to check, what may be broken, or where the >design may be wrong. Any chance the weak pullup on GP1 is getting enabled? What if you measure the current to ground? It doesn't exactly fit your symptoms, but there are only a few of ways that current can flow out of that pin, and that's the only one that seems to fit. If you had some source of current into the protection diodes, then that might be an explanation, but that looks even less likely. >I have tried the circuit numerous times, and have 5 different >PIC12F675's, and at least two of them have shown this 'broken' behaviour. > >The trace from R9 to GP1 (the door sense trace) runs underneath both >C1 and R1 which are 1206 footprint parts. I initially suspected that >there was a solder bridge from one of these pads to the trace, but, >that appears not to be the case, and, it would be a consistent >problem, rather than the delayed/intermittent one. > >About the only thing I can believe to be happening is that there is >a short of some sort between pin AN0 and GP1 causing the 1.25V >reference voltage to appear on the GP1 pin. The REF3312 is able to >sink current to maintain 1.25V, so, with the effective 2K impedance >3.3V source when the sensor circuit is closed, and with the 1K >between pin AN0 and the REF3312, I do some math, and determine.... > >IF the pins have a resistance bridge between them somewhere, the 1M >pull down resistor R3 is not enough to drop the voltage at pin GP1, >but, when the door is open (the switch is closed), the 3.3V source >with 2K impedance is enough to pull the 1.25V to 1.32, or to raise >it 0.7V .... but, it makes no sense that AN0 does not change....... > >Finally, before I got so stuck in to the problem, I decided that the >1M pull-down was not 'strong' enough, so, I decided that it may be a >'capacitive' build up on pin GP1 that was causing the problem. To >'resolve' this perceived issue, I decided to set the GP1 as an >output, and output low for 50us before setting the pin back to an >input for another 200us or so before reading the pin's state through >GPIO. I figured this would be enough to drain any 'spurrious' >charges on the pins. > >But, it was not successful.... > >Anyone have any ideas? > >Anyone suggest another avenue to explore? > >Thanks in advance > >Rolf > >0.0 > > > >-- >http://www.piclist.com PIC/SX FAQ & list archive >View/change your membership options at >http://mailman.mit.edu/mailman/listinfo/piclist Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist