Modifying the bootloader..

So quick run down of my situation, I have an Atmega2560V (3.3V) battery powered and a circuit designed to toggle power source between battery and USB.

The problem I have is that the bootloader (from what I gather) is setting the pin TXD0 (PE1) high during start up. I assume this is for serial comms setup stuff. What then happens is, this causes the FTDI chip to partially power up, pulling the 5V USB rail to 2V.
The bad news here is that this then activates the circuitry responsible for disconnecting the battery from the input of the voltage regulator, and power down the entire circuit. Once powered down, it starts up again, only for it to power down again and on and on it goes.

I skipped the bootloader and flashed my source HEX file straight into the device, this resolved the issue, but I want to be able to upload code over USB.

So... anyone know what I would need to do to deactivate the TXD0 pins in the bootloader code? I plan to enable USB comms from within my own source code, so I'm guessing I will need to handle the serial comms setup stuff in my code?

If you only use that pin for comms then can you break it out and put a jumper on it so you can jumper to upload and remove for in service?

Hi Riva, I'm using it for data output too so what I need to do is somehow disable comms during statup and in my source code, activate serial comms only when the USB cable is plugged in. Sorry should have been clearer.
I should also mention, I have a design on PCB, so I want to try and solve this with software first if possible.