Mega 2560 will not program.

I am using the mega with a Ramps1.4 shield on a 3d printer. I have programmed it at least once in place ( I have 2 megas with the same issue , one has been programmed in place many times.
The last time I tried to program in place, it failed and the ide said serial port_ not found. The board has been operating the printer via USB commands, windows sees the board as com_ . Arduino IDE pulls info off the board - but will not program it. They have the same error when trying to program on a different computer.
I have tried deleting com port but it makes no difference.The comm port works, the mega works,Arduino IDE reads the board - just fails to see the board when programming.

I have gotten a USBASP in preparation for isp programming if required.

Any suggestions would be appreciated, I am on my last mega and it is a pain to pull out for programming.

The USB is handled by a 16U. And I havent tried to go into DFU but have downloaded Flip.

The 2 computers run win7 and 10, IDE is 1.6.11 with 1.6.11 Arduino in boards manager due to RAMPS compile issues with newer IDE versions.

The computer and Arduino comm ports seem fine because_ Computer recognizes Mega on com5, IDE recognizes the mega comm port, the IDE reads board Info, Printer responds to manual control via usb through the MEGA.

The 2560 works because the printer works manually and runs 3d files.

So is the boot-loader completely bypassed after boot , or does it "pass through commands"? If it is bypassed a corrupted boot-loader would explain the issue, just not what corrupted it. Also is the board info that the IDE reads stored in the 16u or the 2560?

I think the 'board info' is based on the USB Vendor ID and Product ID. Try programming with the RAMPS board removed.

They will not program with or without ramps board or on an different computer - but they appear to function otherwise.

mfisch:
They will not program with or without ramps board or on an different computer - but they appear to function otherwise.

Sounds like the USB-to-Serial part of the board has gotten damaged. An over-voltage could have done that. Are you powering the RAMPS board with more than 12V?

12v. The regulator would have to fry before other items are damaged. Serial coms between usb and 2650 work - the board works via manual as well as program commands