Atmeg16 USART communication problem
You must connect Rx, Tx and ground.
When you supply power from USB then they both PC and mcu operate on a common ground, when you use a battery that ground connection between mcu and PC doesn't exist. 

Connect the grounds of USB and battery(-pole) and it should get fixed.