I am trying to putoading Bootloader with Atmega_Board_Programmer problem

I am trying to put a bootloader onto an Arduino UNO I replaced the chip on. I ran across this topis while attempting to program the chip by a variety of methods unsuccessfully. However when I upload the Atmega_board_programmer sketch, the console shows a repeating message:

[Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Feb 15 2017 at 18:48:05 witþ
Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Feb 15 2017 at 18:48:05 witþ
Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Feb 15 2017 at 18:48:05 witþ
/quote]

The actual code from the sketch is:

void setup ()

{
  Serial.begin (BAUD_RATE);
  while (!Serial) ;  // for Leonardo, Micro etc.
  Serial.println ();
  Serial.println (F("Atmega chip programmer."));
  Serial.println (F("Written by Nick Gammon."));
  Serial.println (F("Version " VERSION));
  Serial.println (F("Compiled on " DATE " at " TIME " with Arduino IDE " xstr(ARDUINO) "."));

initPins ();

}




Not being much of a programmer much less a debugger I don't know why it prints a cryptic character instead of the "with Arduino IDE...". Of course the program doesn't continue to perform the desired actions.
I tried on IDE 1.8.1 (Windows 10) and IDE 1.0.6 just in case there was a level issue but had the same result.
Help would be much appreciated.

This is what I get.

Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Feb 16 2017 at 14:27:41 with Arduino IDE 10800.
Attempting to enter ICSP programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x95 0x0F
Processor = ATmega328P
Flash memory size = 32768 bytes.
LFuse = 0xFF
HFuse = 0xDE
EFuse = 0xFD
Lock byte = 0xEF
Clock calibration = 0xA1
Type 'L' to use Lilypad (8 MHz) loader, or 'U' for Uno (16 MHz) loader ...

I am using a cable modified to bring pin 5 from the cable to pin 10 of the Uno used as a programmer. The other end of the cable goes to the chip being programed. My Serial Monitor is set to 115000 Baud. In order to help you, we would need more information on how you are hooked up. I can't tell but it looks like your programmer is being reset repeatedly.

This is what I get without the cable connected to the chip to be programmed.

Atmega chip programmer.
Written by Nick Gammon.
Version 1.37
Compiled on Feb 16 2017 at 14:27:41 with Arduino IDE 10800.
Attempting to enter ICSP programming mode ......................................................
Failed to enter programming mode. Double-check wiring!
Type 'C' when ready to continue with another chip ...

Something tells me the board is repeatedly being reset somehow.. - is the board acting as programmer showing the blink of the bootloader?

Very consistent timing - 100 characters each time.

On a fluke I selected the Fix Encoding and Reload option in the tools menu and it uploads and runs. Now I just have to figure out how to get it to enter programming mode.The wiring between the ICSP headers is correct. It probably needs a capacitor somewhere.
GB

Not so fast. Double checking the wiring for the umpteenth time, the #5 wire to D10 had broken. Repaired it and the first problem reappeared. Disconnected the wire and it uploaded and ran although it could not enter programming mode.

SOLVED - again. I have decided there must be something wrong with one of the ICSP headers, maybe a cold solder joint. I had verified connectivity through the wiring harness but I connected the two UNOs together with wires from the digital ports and everything worked as advertised.