-2

I have connected mc to a pc using USB. I need data on hyperterminal through serial to USB connection, hence I connected TX, RX and gnd pins of the Leonardo to the rs232 pins and one other side of rs232 to USB to pc. However, the data is still transmitting on serial monitor, but not on hyperterminal.

int count = 0;

void setup() {
  Serial.begin(9600);
  pinMode(3,INPUT); // This is the pin to which we have connected the button
  attachInterrupt(0, IRsensor, CHANGE);
}

void loop() {
  if (Serial.available()) {
    /* read the most recent byte */
    /*ECHO the value that was read, back to the serial port. */
    Serial.write(count);
  }
}

void IRsensor() {
  if(digitalRead(3) == 1) {
    count++;
    Serial.println(count);
  }
}
4
  • hi sir thanku but i want external tool to know the data of arduino processed and to control it i am transfering data but it is not displaying on hyperterminal window
    – user4918
    Nov 21, 2014 at 10:16
  • r else pls suggest me any tool to operate this connection serially
    – user4918
    Nov 21, 2014 at 10:17
  • no need to call. Connect your arduino to pc with same usb that you use to program and open hyperterminal
    – Martynas
    Nov 21, 2014 at 10:26
  • see my updated answer
    – Martynas
    Nov 21, 2014 at 10:37

1 Answer 1

3

To be sure, please add code.

You can use usb on Arduino to communicate with pc. You don't need RS232/USB converter. Just open hyperterminal with the port of arduino. Arduino port can be found in:

  1. Arduino IDE Tools>Port
  2. My Computer>Properties>Device manager>Ports

If you really need SoftwareSerial then connect Rx,Tx and don't forget GND!

UPDATE

To communicate with RS232/USB converter you have to add RS232/TTL converter to Arduino side. The schematic would look like PC <-> USB/RS232 <-> RS232/TTL <-> Arduino:

  1. PC - your computer
  2. USB/RS232 to convert from usb to RS232. On RS232 side the voltage is -5V to +5V
  3. MAX232 RS232/TTL. To convert the voltage
  4. Arduino - your MCU

UPDATE 2

As i said, connect your arduino to PC like you do while programming.

enter image description here Next, upload this sketch:

void setup() {
  Serial.begin(9600);
}

void loop() {
  if(Serial.available()){
   Serial.print("\nReceived: ");
   Serial.write(Serial.read());
  }
}

Open HyperTerminal: choose port with Arduino,

enter image description here

Connect to arduino, Serial Monitor has to be closed

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.