0
\$\begingroup\$

I have a PIC16F684 with buttons connected to PORTA:0 & PORTA:1 which are also used for ICSP DAT & CLK. The ICSP signals are coming from a PIC programmer which I've built using an Arduino. The DAT & CLK lines are driven by IO pins and I'm not sure of what to set the IO lines to so that they allow the buttons to be read by the PIC. I've enabled the weak pull-ups and buttons on other PORTA lines work fine. Should I use series resistors on the button lines? I've tried 180 ohms at points A & B but the signals are still being influenced by the ICSP lines. I've also tried 180 & 660 ohm resistors at C & D, still no luck.

So - how do I isolate the ICSP lines when the programmer is idle? I could use a FET but it seems like overkill...

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
0
\$\begingroup\$

If I understand correctly, you want to support ICSP, and once the target is programmed, you want the buttons to function normally.

In that case, simply modify your Arduino programmer to set it's CLK and DAT lines as inputs, effectively removing them from the system. Now your target can set up it's inputs as it wants, which in this case is probably with pullups.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ That's it, thanks! I thought I had tried that but I guess not, because they work now. \$\endgroup\$ – Charlie Skilbeck Mar 18 '16 at 22:36
  • \$\begingroup\$ Glad I could help! \$\endgroup\$ – Brendan Simpson Mar 18 '16 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.