Need Help for AVR program to run on Arduino Mega (Network Cable Tester)

Hi,
I wanted to add network cable tester and length tester in my existing project.
here is link to my existing project

I found very good DIY on Russian forums Link is bellow ( with English translation)

My problem is i can not understand connection for Mega and how to change program to work with mega.

Thanks in advance
I attached original program file

lan_tester.c (10.4 KB)

You will probably need to change some of the I/O registers. Those are the 'variables' named PORTx/PINx/DDRx where 'x' is a letter: A, B, C, or D. Note: the Arduino UNO has no PORTA so this must be for a different processor. Each port represents a set of 8 pins. The Data Direction Register (DDRx) sets each pin to Input or Output. The PORTx register is for writing to the Output pins and the PINx register is for reading from the Input pins.

You will want to find a chart that shows what ports are connected to what pins. Not all pins of every port go to the female headers that Arduino users normally think of as 'pins'.

The ADxxx registers control the A/D converter. The TCCR1x registers are the Timer/Counter Control Registers for Timer1.

Thanks for reply.

My question is i am using arduino Mega,,
there are ADC0 to 7 are same as any analog pin on Mega.
What about Pins PC0 to PC7 ??
Are they PWM or Digital or any other type??
SCL, SDA, TCK,TMS. TDO, TDI, TOSC1, TOSC2 ???

Thanks

Have a look at the Mega pin mapping.

ArduinoGuru:
Thanks for reply.

My question is i am using arduino Mega,,
there are ADC0 to 7 are same as any analog pin on Mega.
What about Pins PC0 to PC7 ??
Are they PWM or Digital or any other type??
SCL, SDA, TCK,TMS. TDO, TDI, TOSC1, TOSC2 ???

Thanks


It use ATMEGA16 MCU

For arduino Mega,
you can use PORTF for ADC0 to 7
Pins PC0 to PC7 is from D37 to D30
for PD0 to PD7 you can use D22 to D29 as PORTA