Simple, but need to ask. Are you sure RA1 is set to digital?
I checked an re-checked all over again; I even changed my breaboard.
Finally, I tested all components and surprise: R2 has infinite resistance (should be 12k!).
Everything is fine and the circuit works well now.
Thank you to All for your help.
I add the corrected shema - hope I didn't made a mistake this time.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2707&stc=1&d=121484865 4">
Roger
If all you need is a push button to turn on the circuit and the PIC to turn it off then I have tested a simplified circuit that uses a MOSFET. Low part count = lower cost! I didn't have a P-MOSFET laying around, but I *think* that you could replace my Q1 with one and that would eliminate R2 in my circuit too.
Guy
Bookmarks