Hello,
I have got a new problem. After I scanned for the I2c devices ,
No I
I2C Scanner
Scanning...
Unknown error at address 0x10
No I2C devices found
Scanning...
No I2C devices found
Scanning...
No I2C devices found
Scanning...
No I2C devices found
Scanning...
No I2C devices found
That means you have no working device connected to your I2C. If you connected some device, it doesn't work or it's wiring is incorrect. As you didn't provide more information we cannot help you further.
chutki:
Pardon me, I have connected an Atmega microcontroller at the pins at SDA and SCL (20,21). I do not understand
All 8-bit Arduinos have ATmeag microcontrollers but I think none of them have SDA and SCL on pins 20 and 21. I guess you're using a Mega2560 which have SDA and SCL on D20 and D21. The ATmega microcontroller is the main chip of an Arduino but it's not the same.
Unknown error at address 0x10
That means that the Arduino either lost bus arbitration or an illegal start/stop condition was reached. Both usually mean that the wiring isn't correct. Did you connect the GND? What chip are you connecting? Do the voltages match? Are the pull-ups correctly calculated?
This is not a software problem but a hardware problem, so please provide as much information about your hardware (chips, boards, wiring, schematics, etc.) as possible.
The ATmega256 has the I2C pins on 25/26. Are you really sure that you're using that MCU?
I have supplied power to arduino due by its programming port, and powered the Atmega from DUE,through its ouput voltage pins.
Why do you use two CPUs? What's the tasks of the Due, what the tasks of the ATmega MCU?
You supply information in small chunks, that's not how the rules in this forum work. Provide all the necessary information! Start with a complete wiring diagram of your setup and links (URLs!) to all boards/chips you connect to your Arduino. Then post the code you use for your tests. If you don't use a standard Arduino provide a link to the used board. If it's a standard Arduino post the type as it is listed in the official Arduino webshop.