not able to write data using tx -rx pin of mega 2560

hello ,
i am very new to arduino.i am trying to control a motor with encoder using serial port of arduino.i am not sure whether there is need to use a rs232 level convertor here.I am trying to send the command M255(which was supposed to be sent through hyperterminal) to move the motor at maximum speed.i have checked many tutorials on youtube.nothing helped.please help me out.i have attched the detailed pdf .

Cur_Driver.pdf (1.36 MB)

Where is your code?

this is my code when i was trying to use sda and scl line to communicate with the motor encoder whicha has slave address of 0x10…
#include <Wire.h>
int motor_address = 16;

void setup()
{
Serial.begin(9600);
Wire.begin();
}
void loop()
{
Wire.beginTransmission(motor_address);
Wire.write(255);
Wire.endTransmission();
Wire.requestFrom(motor_address,1);
while(Wire.available()==0);
int c=Wire.read();
Serial.print(c);
Serial.print(“c,”);
delay(500);
}

but it didnt work …i followed all steps mentioned in the attched pdf.then i tried using serial…i have written a simple code which doesnt work…i am just using serial.write(“M255”)to just run the motor at maximum speed,but its not working.tell me how to proceed i will try that .

I can't open your PDF file, it appears to be damaged.

Aside from that, Im not sure if it needs an instruction byte or not, so try using this, Wire.write(byte(0x00));

Check this out. DigitalPot

supernova0809:
i am not sure whether there is need to use a rs232 level convertor here

Find out, before you connect anything up. If you need one but don't use one, or use one but don't need one, you are very likely to damage either the Arduino or the device you're connecting to it (and in any case it won't work).

i am very new to arduino.i am trying to control a motor with encoder using serial port of arduino.

No, you aren't. Serial data is sent using Serial.print() or Serial.write(), NOT the Wire class.