How to make two WIR 1186 RF transceivers communicate over serial communication? I want to have two RF transceivers communicate, one as transmitter and one as a receiver, for longer distances. For that I'm using WIR 1186 RF modules with Arduino.

Pin connections are as below:


Arduino :5v,gnd,RX,TX,2,3
WIR1186 :VCC,gnd,Tx,Rx,prg,cts


But Arduino is not serially communicating with the WIR1186 module.

Below is the code:

char ch;
int prog = 2;
int cts = 3;
int stat;
unsigned int output;

void setup() {
  Serial.begin(9600);
  pinMode(prog, OUTPUT);
  digitalWrite(prog, LOW);
  stat = digitalRead(prog);
  Serial.println(stat);  
  Serial.write("B=9600\r\n");
  output = Serial.read();
  Serial.println(output); 
  digitalWrite(cts, HIGH);
}

void loop() {
  Serial.write('a');
  delay(1000);
}


Here is the datasheet of WIR1186

Please help me out with this.
If you use pin 2 and 3 for serial communication you have to use SoftSerial, because Serial is hardwired to pin 0 and 1.