How to connect a large exisiting code (some simulator) to the AVR Studio Simulator?
You cannot simulate thinks like motor,LED,LCD screen or any type of external components in the AVR simulator.You can run the code and see how the code works internally inside the chip.You also cant get response from the simulator like which you like to get response from a device.You can use Multisim simulator to run your code in PC with external components connected but still you may or maynot get response from a output device.In Multisim,simulation with ATmel's 89C51 is possible.I dont have idea on other Mega series of MCU. You can try Proteus ISIS software to get mere expected simulation.It contains lot of microcontrollers and external components.So probably,Proteus will help to solve your problem.  THe screenshot is attached to configure ATmel studio as simulator  Here is how it's looks like,when you run by 'debug with break'.To move next step,click on Stepin(F11 shortcut).To move to a specific line,drag the cursor to the specific line and then stepinto(F11 shortcut).You can see the changes happening in General Purpose registers,I/O pin registers,RAM etc due to your code.