UART and ICP on the same pics, how do I need to make it work?

I am connecting my XBEE 900HP to a 18F24k22 Microcontroller to use the internal UART to communicate. I’m using the UART1 for a bluetooth module so I have to use the UART2 (pins 27 and 28 on the 28-SSOP) to control the XBEE. But those pins are also the PGD and PGC to program the firmware. To be specific, Pin27 (PGC) will connect to the XBEE-RX pin. Probably no problem there. But Pin28 (PGD) will connect to the XBEE-TX pin. This is the problem. And of course the 3.3V rail will be powered when I program the Microcontroller so the XBEE will be powered too.

What can I do to be able to flash my PIC and have my XBEE wired up. I could install a jumper to be removed when you flash, but then there is the possibility the jumper could fall off (or corrode) and I’m lose my XBEE signal…


Try adding a 485 chip or something of that nature.