boot load followed by test

I've made a simple pcb, but awaiting some zif sockets, so at the moment this question is more hardware related than software. The intention is to load the bootloader via a Nano to a dil atmega328. io pins 10,11,12,13 of the Nano are connected to the appropriate pins of the 328, as well as 5V and gnd. This should allow the boot loader to be installed on the atmega328. The voltage supply will be via the usb connection of the nano. On the same pcb I was going also to have a usb to serial unit, also connected to the 5V and gnd of the 328, and the signal lines to pins 2 and 3. Now unplugging the Nano from its USB will still leave it powered by the usb/serial unit. I assume that may cause problems to the Nano, since its i/o ports could be driven by whatever voltage may appear on the 328 chip. If I were to install the blink program as a test, then pin 13 of the Nano is connected to pin 19 of the 328, for example, although I could change the io pin for the blink 328 test.
So, I guess the fundamental question is can two arduino's have any of their i/o pins connected? Will it be better if the power is removed from one of the arduinos, but i/o pins still connected.?
It will be easy enough for me to have separate pcbs, one for bootloading, one for downloading, but it would be one thing less to lose if both functions could be on the same pcb, I've had a look through the 328 specification data sheet, but don't know exactly where to look (and probably what to look for)
Thanks.

It is good to have just one power source during programming for both. The best is to use the power from the programmer. Also, it is able to power the programmer from the board but there is a problem with power from USB in your case. Sometimes it is not possible at all, then do not connect 5V between programmer and target but make sure the voltages are the same like between 4.9-5.1V.

Thanks for your reply, Budvar. I seem to remember, maybe ten years ago when I was using Pics, that the state of the i/o pins were indeterminate, until set be the program. I don't know about the Atmel chips, but if I assume the same, then it will be separate boards. I may breadboard something up, but then can't rely on the result if it works (but can if it don't)
Thanks, Best wishes

raymw:
It will be easy enough for me to have separate pcbs, one for bootloading, one for downloading, but it would be one thing less to lose if both functions could be on the same pcb

If it were my project, I would prefer to make the programmer a separate unit. The reason is that then you could use a single programmer whenever you needed to program any microcontroller in any of your boards or projects.

raymw:
I’ve had a look through the 328 specification data sheet, but don’t know exactly where to look (and probably what to look for)

I’m no expert in this topic, but I’ve seen others refer to table 30.1 (Absolute Maximum Ratings) to answer this question:

Voltage on any Pin except RESET
with respect to Ground . . . . . . . . . . -0.5V to Vcc +0.5V

Which indicates that if Vcc is 0 V then the absolute maximum voltage you should apply to the pins is 0.5 V.

Hi Per, thanks for the table reference - the Vcc +.5 is the problem, (page 322 of the pdf) if the chip is unpowered (Vcc =0V). I still feel half inclined to try what I was originally wanting to do, but having thought a bit more and done a bit of internet surfing, I'm not sure if I want to risk wasting a few chips. I may well grow out of it.
I could set the Nano pins into inputs, and ignore the results, or use switches in the four lines, but it will be just as quick to use a seperate programmer. It's not as if I'm ever likely to be doing more than a few.

Applying voltages to an I/O pin on an unpowered chip is the most common way to blow out pins on the unpowered chip. Don't do it.

I agree with Per's approach - make the programmer separate. Put on the 2x3 ISP header, and use your choice of ISP programmers (USBAsp clones are like $3 on ebay).