Rolf, I'd also suggest stronger pulldowns than 1Meg on the door switches (and capacitors), To minimise power consumption, maybe retain the 1Meg resistors, but add 10ks to a "spare" pin and activate these only when taking a reading. You should be able to figure out a way to use pin 5 as the pulldown pin as it's only used once for code setting. (I think). I was going to suggest swapping the connections from the "good" & "bad" doors, but since the problem remains with neither attached, it seems more a software or pcb problem than external hardware. Since it always (?) works OK for the first few hours, I'd suspect a software, rather than hardware issue. Getting the memory banking wrong can lead to all sorts of strange problems and I wouldn't have been surprised if your problem is now fixed (But obviously not however, based on your latest email). Possibly another, similar error somewhere? Richard P 2008/6/30 Rolf : > Thanks... > > The device has two door channels. Building it for myself, and then > another for a friend. > > The wires on the magnetic switches are about a foot long. Pretty short I > thought. The device will sit between the two doors on the centre column. > > I debated the 1M pull downs. I pull all pins down except the AN0 pin. I > figured 1M was at the high end, but I did not want to go as low as 10K. > I could have gone 100K or there abouts, but I was really pushing for > long battery life. In the end, I guess I get 4 years of continuous use > out of two 3000mAh Lithium cells, and because of the nice discharge > curve, the power will be there till the end. > > I could change out the 1M resistors easily, but, they seem to be > working, unless they are not, of course. > > My problem is that the circuit board is home-made. I believe it to be of > high quality and I did a full board test before I soldered anything on. > There were no bridged traces, and, after soldering on everything, I had > one bridged trace which I was able to resolve... > > It is possible that there is another bridged trace, but I can't find it, > and I have looked hard. Also, because I don't have a solder mask, I have > 'brushed' the board with epoxy to protect the exposed copper. Changing > things now will be a little messy, but possible. > > I was sort of thinking that I could enter the project in to Jason's PCB > contest to get free PCB's.... but I may just go through sparkfun too. > But, first it has to work. > > As for the antenna, I am using an RP-SMA mounted antenna, and it has 4 > ground 'pins'. That's why it has the 4 legs. > > The receiver is already designed, built, soldered too. It all works > quite well, when it works. I have been doing this one for a few months > now, it is really frustrating to only find the problem now... > > Rolf > > > > Michael Hagen wrote: >> Nice project Rolf! >> >> If you have long wires going to your door sensor magnets, I would suggest >> lowering the 1M to ground to 10K and bypassing them with caps. You have >> quite an "antenna system" there. In fact I would use a dual opto-isolator >> on those inputs. I did that on quite a few projects in a factory >> environment. >> I know you are on batteries, but isolating those wires from rf interference >> is necessary. Besides radio RF there are other things in the garage, tools, >> washer, dryer, and the garage door motors themselves. All could cause >> problems. >> Maybe you could use a counter hooked to your sleep interrupt to extend data >> transmission to a few minutes to save power too? >> >> My Ham radio here caused the neighbors solar circulation system to start >> when I went on 40 and 20 M! >> They were really mad at me when they figured it out. >> The wires were just right, about 33ft long! Several 0.1uf caps saved the >> day. >> >> What do you have figured out for a receiver? Is it done yet? >> >> Now if I could just shut the doors from inside the house with this system? >> Oh...another project! >> >> Good Luck, >> >> Mike >> >> ----- Original Message ----- >> From: "Rolf" >> To: "Microcontroller discussion list - Public." >> Sent: Sunday, June 29, 2008 10:16 AM >> Subject: Re: [PIC] Strange PIC12F675 or user problem... pin cross-connect? >> >> >> >>> Hmmm... >>> >>> I found a bug in the code. I was not ensuring I was in memory bank 0 in >>> the ISR. This could have caused all sorts of problems, I guess, but, >>> could it have caused this one? The only SFR's that the ISR modifies are >>> GPIO, and TMR0 which in turn, if I was in the wrong bank, would have >>> modified TRISIO, and the OPTION register. >>> >>> I guess the combination of those two registers could do some pretty >>> weird things to the code, but, changes to the prescalar or TMR0 clock >>> source would have been very obvious, and changes to the TRISIO would >>> also have been noticed.... I think. >>> >>> Anyway, I have fixed the code, but now have to wait (forever) to see if >>> it breaks again..... >>> >>> Still looking for advice. >>> >>> Rolf >>> >>> Rolf wrote: >>> >>>> Two additional items of information: >>>> >>>> To 'fix' the circuit, I disconnect the battery and wait a while before >>>> re-connecting it. >>>> >>>> I can unplug the magnetic switch entirely leaving the circuit open and >>>> it is still 'broken'. Also, one test showed that when working fine, >>>> with the switch disconnected, it still later 'broke'. >>>> >>>> Thanks again >>>> >>>> I can supply the source code too... actually, it is attached. >>>> >>>> Rolf >>>> >>>> Rolf 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. >>>>> >>> [snip] >>> >>> >>>>> Anyone have any ideas? >>>>> >>>>> Anyone suggest another avenue to explore? >>>>> >>>>> Thanks in advance >>>>> >>>>> Rolf >>>>> >>> -- >>> http://www.piclist.com PIC/SX FAQ & list archive >>> View/change your membership options at >>> http://mailman.mit.edu/mailman/listinfo/piclist >>> >>> >> >> > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist