Arduino mega USB to FTDI

Hi everyone!

I am working on a 3D printer controller board and I would like to use Atmega2560 with Arduino mega bootloader as the hear of it. I have most of the schematics made, I'm also almost done with drawing PCB. To make things clear I am not using Arduino mega board, Atmega2560 is integrated into the controller.
Now I'm only left with making sure board communicates well with the computer. I searched around the web for the Atmega8u2 USB to FTDI code but only found code for Atmega16u2. Normally that wouldn't be the problem, it's just that I only have Atmega8u2 in my workshop and store has no Atmega16u2. Does anyone perhaps have USB to FTDI code for Atmega8u2? I know that those chips are used in some arduino mega boards.
Also would Atmega2560 with arduino mega bootloader go well together with FT232RL or are there any possible problems with that configuration.

Sorry if some of this questions are stupid but so far I only used FTDI breakboards with standalone arduino and whole arduino boards.

Thanks in advance!

The firmware is included in the Arduino IDE.

On a Mac it is in the Package Content:

/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/firmwares/atmegaxxu2

In the same folder you will find a README.txt.

USB to FTDI code for Atmega8u2

http://arduino.cc/en/Main/USBSerial

The code is LUFA, but stripped down in functionality. Main LUFA Site:

Edit - fix tags. (Thanks LarryD)

mrburnette:
[USB to FTDI code for Atmega8u2](http://USB to FTDI code for Atmega8u2)

The code is LUFA, but stripped down in functionality. Main LUFA Site:
http://www.fourwalledcubicle.com/LUFA.php

First link is broken.

Sarumanar:
I searched around the web for the Atmega8u2 USB to FTDI code but only found code for Atmega16u2.

FTDI is a company. I think you mean "USB to Serial". Serial is not another word for FTDI.

If you have the actual source code, the code for the 16u2 and 8u2 should be interchangeable.

All of the code used on the Arduino boards can be found in the github project:
https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares/atmegaxxu2