porblems with softserial not reading

I'm using an Arduino Uno for a project, it will be writing and reading to a device with a UART.

I've found the softserial example sand working through those, I can write easily enough form the Ardunio on a soft serial (I can see thsi on my PC) but I can not detect when I am writing to it. I've got this code below which I've put togtehr form the examples in the IDE.

To debug it I've added a piece of code to toggle the pin 13 LED within the portOne.available() > 0 statement.

My setup is the arduino softserial port connected to a FTDI cable into my PC, running teraterm. I can see the "hello world" apprearing OK, so I know that's good.

I've put a scope of Arduino pin 8 and I can see this line toggling when I send a character through teraterm. So I know a signal is getting into the arduino Rx pin.

To debug the code I've added a toggle to pin 13 LED within the portOne.available() > 0 statement, this LED doesn't toggle and I've scope dteh line and it's always low (my default).

Any advice greatfully received.

#include <SoftwareSerial.h>
// software serial #1: TX = digital pin 10, RX = digital pin 11
SoftwareSerial portOne(8,9);
const int ledPin =  13; 

void setup()
{
 // Open serial communications and wait for port to open:
  pinMode(ledPin, OUTPUT);  
  digitalWrite (ledPin, LOW);
  Serial.begin(9600);
  while (!Serial) 
  portOne.begin(9600);
}

void loop()
{
  portOne.print("Hello World :)"); // send something
  portOne.end(); // end communication on the first software

  portOne.listen();
  Serial.println("Data from port one:");
  // while there is data coming in, read it
  // and send to the hardware serial port:
  while (portOne.available() > 0) 
    {
    digitalWrite(ledPin, HIGH);  
    char inByte = portOne.read();
    Serial.write(inByte);
    delay(10);
    digitalWrite(ledPin, LOW);
  }
  delay(1000);
}
// software serial #1: TX = digital pin 10, RX = digital pin 11
SoftwareSerial portOne(8,9);

Your code doesn't match your comment. If you are going to have useless comments, you must make the code match them.

  while (!Serial)
  portOne.begin(9600);

That is almost certain NOT what you want to do. Waiting for Serial to be read is necessary only on the Leonardo and Micro. If you don't have either of those, get rid of the while statement (and missing body).

Try commenting out the ...
portOne.End();
command

thecoolerking:
I'm using an Arduino Uno for a project, it will be writing and reading to a device with a UART.

I've found the softserial example sand working through those, I can write easily enough form the Ardunio on a soft serial (I can see thsi on my PC) but I can not detect when I am writing to it. I've got this code below which I've put togtehr form the examples in the IDE.

To debug it I've added a piece of code to toggle the pin 13 LED within the portOne.available() > 0 statement.

My setup is the arduino softserial port connected to a FTDI cable into my PC, running teraterm. I can see the "hello world" apprearing OK, so I know that's good.

I've put a scope of Arduino pin 8 and I can see this line toggling when I send a character through teraterm. So I know a signal is getting into the arduino Rx pin.

To debug the code I've added a toggle to pin 13 LED within the portOne.available() > 0 statement, this LED doesn't toggle and I've scope dteh line and it's always low (my default).

Any advice greatfully received.

#include <SoftwareSerial.h>

// software serial #1: TX = digital pin 10, RX = digital pin 11
SoftwareSerial portOne(8,9);
const int ledPin =  13;

void setup()
{
// Open serial communications and wait for port to open:
  pinMode(ledPin, OUTPUT); 
  digitalWrite (ledPin, LOW);
  Serial.begin(9600);
  while (!Serial)
  portOne.begin(9600);
}

void loop()
{
  portOne.print("Hello World :)"); // send something
  portOne.end(); // end communication on the first software

portOne.listen();
  Serial.println("Data from port one:");
  // while there is data coming in, read it
  // and send to the hardware serial port:
  while (portOne.available() > 0)
    {
    digitalWrite(ledPin, HIGH); 
    char inByte = portOne.read();
    Serial.write(inByte);
    delay(10);
    digitalWrite(ledPin, LOW);
  }
  delay(1000);
}

You have coded both SoftwareSerial ( and disabled it - post #2 ) and Serial , but you stated using "teraterm" terminal software.
As coded you also need to run IDE COM port to see the Serial output. Or output ALL to SoftwareSerial.

mrsummitville:
Try commenting out the ...
portOne.End();
command

This has fixed it. Very obviosu now I look at it. thanks.