Go Down

Topic: Problem with softserial on Duemilanove (Read 1 time) previous topic - next topic



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.println("Please Work!");

  // set the data rate for the SoftwareSerial port


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

Thanks for any help of guidance


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?


Rob Tillaart

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


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