I've done a (very) quick hash at a schematic - with a few revisions:

The PIC to be programmed in-circuit with a PICkit2 or PICkit3. You'll need to make sure your CNC device is unplugged when you...