Go Down

Topic: Problem with softserial on Duemilanove (Read 434 times) previous topic - next topic

x3mz

Hello,

I have a problem reading from a barcode scanner from any other pin then the rx(0)
I am getting the required code and everything works great with the normal Rx pin. but once i use the Newsoftserial library with any other pin (tried with 2 8 and 9)i get a weird output: 45b?D$F4T$6?รพ instead of getting 451004002400035238
does anyone know what the real problem is?
is it from the library itself?
here are some more information:
I am using a max233cpp chip between the barcode and the arduino Duemilanove
all the connections seems to work fine with the rx pin of the arduino
my barcode reader has a baud rate of 9600

and here is the sample program that i am using with software serial 11 beta

#include <SoftwareSerial.h>

SoftwareSerial mySerial(9, 4);

void setup() 
{
  Serial.begin(9600);
  Serial.println("Please Work!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);

}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.print((char)mySerial.read(), BYTE);
  if (Serial.available())
    Serial.print((char)Serial.read());
}


Thanks for any help of guidance

robtillaart


you should use NewSoftSerial iso SoftSerial as it performs much better.  - http://arduiniana.org/libraries/newsoftserial/ -

INterface is the same, but under the hood things are fixed.

Also check the config of the barcodereader for # stopbits should be 1.

Does the barcode reader work on the hardware Serial?

Succes,
Rob


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

x3mz

Thank you for the reply!
Indeed you have inspired me to ding into the documentation of the barcode reader, and change the way it transmits data.

for future reference use Fujitsu rs-232C standard. that will work with the newsofserial of the arduino on any pin.

Thanks again! :)

Go Up