NewSoftSerial

A New Software Serial Library for Arduino

News: NewSoftSerial is in the core!  Starting with Arduino 1.0 (December, 2011), NewSoftSerial has replaced the old SoftwareSerial library as the officially supported software serial library.  This means that if you have 1.0 or later, you should not download this library.  To port your code to 1.0, simply change all NewSoftSerial references to SoftwareSerial.

NewSoftSerial is the latest of three Arduino libraries providing “soft” serial port support. It’s the direct descendant of ladyada’s AFSoftSerial, which introduced interrupt-driven receives – a dramatic improvement over the polling required by the native SoftwareSerial.

Without interrupts, your program’s design is considerably restricted, as it must continually poll the serial port at very short, regular intervals. This makes it nearly impossible, for example, to use SoftwareSerial to receive GPS data and parse it into a usable form. Your program is too busy trying to keep up with NMEA characters as they arrive to actually spend time assembling them into something meaningful. This is where AFSoftSerial’s (and NewSoftSerial‘s) interrupt architecture is a godsend. Using interrupt-driven RX, your program fills its buffer behind the scenes while processing previously received data.

Improvements

NewSoftSerial offers a number of improvements over SoftwareSerial:

  1. It inherits from built-in class Print, eliminating some 4-600 bytes of duplicate code
  2. It implements circular buffering scheme to make RX processing more efficient
  3. It extends support to all Arduino pins 0-19 (0-21 on Arduino Mini), not just 0-13
  4. It supports multiple simultaneous soft serial devices.*
  5. It supports a much wider range of baud rates.**
  6. It provides a boolean overflow() method to detect buffer overflow.
  7. Higher baud rates have been tuned for better accuracy.
  8. It supports the ATMega328 and 168.
  9. It supports 8MHz processors.
  10. It uses direct port I/O for faster and more precise operation.
  11. (New with version 10).  It supports software signal inversion.
  12. (New) It supports 20MHz processors.
  13. (New) It runs on the Teensy and Teensy++.
  14. (New) It supports an end() method as a complement to begin().

*But see below for an important caveat on multiple instances.
**Be circumspect about using 300 and 1200 baud though. The interrupt handler at these rate becomes so lengthy that timer tick interrupts can be starved, causing millis() to stop working during receives.

Using Multiple Instances

There has been considerable support for an library that would allow multiple soft serial devices. However, handling asynchronously received data from two, three, or four or more serial devices turns out to be an extremely difficult, if not intractable problem. Imagine four serial devices connected to an Arduino, each transmitting at 38,400 baud. As bits arrive, Arduino’s poor little processor must sample and process each of 4 incoming bits within 26 microseconds or else lose them forever. Yikes!

It occurred to me, though, that multiple instances could still be possible if the library user were willing to make a small concession. NewSoftSerial is written on the principle that you can have as many devices connected as resource constraints allow, as long as you only use one of them at a time. If you can organize your program code around this constraint, then NewSoftSerial may work for you.

What does this mean, exactly? Well, you have to use your serial devices serially, like this:

#include <NewSoftSerial.h>

// Here's a GPS device connect to pins 3 and 4
NewSoftSerial gps(4,3);

// A serial thermometer connected to 5 and 6
NewSoftSerial therm(6,5);

// An LCD connected to 7 and 8
NewSoftSerial LCD(8,7); // serial LCD

void loop()
{
  ...
  // collect data from the GPS unit for a few seconds
  gps.listen();
  read_gps_data();  // use gps as active device
  // collect temperature data from thermometer
  therm.listen();
  read_thermometer_data(); // now use therm
  // LCD becomes the active device here
  LCD.listen();
  LCD.print("Data gathered...");
  ...
}

In this example, we assume that read_gps_data() uses the gps object and read_thermometer_data() uses the therm object. Any time you call the listen() method, it becomes the “active” object, and the previously active object is deactivated and its RX buffer discarded. An important point here is that object.available() always returns 0 unless object is already active. This means that you can’t write code like this:

void loop()
{
  device1.listen();
  if (device1.available() > 0)
  {
    int c = device1.read();
    ...
  }
  device2.listen();
  if (device2.available() > 0)
  {
    int c = device2.read();
    ...
  }
}

This code will never do anything but activate one device after the other.

Signal Inversion

“Normal” TTL serial signaling defines a start bit as a transition from “high” to “low” logic.  Logical 1 is “high”, 0 is “low”.  But some serial devices turn this logic upside down, using what we call “inverted signaling”.  As of version 10, NewSoftSerial supports these devices natively with a third parameter in the constructor.

NewSoftSerial myInvertedConn(7, 5, true); // this device uses inverted signaling
NewSoftSerial myGPS(3, 2); // this one doesn't

Library Version

You can retrieve the version of the NewSoftSerial library by calling the static member library_version().

int ver = NewSoftSerial::library_version();

Resource Consumption

Linking the NewSoftSerial library to your application adds approximately 2000 bytes to its size.

Download

The latest version of NewSoftSerial is available here: NewSoftSerial12.zip.  Note: don’t download this if you have Arduino 1.0 or later.  As of 1.0, NewSoftSerial is included in the Arduino core (named SoftwareSerial).

Change Log

  1. initial version
  2. ported to Arduino 0013, included example sketch in package
  3. several important improvements: (a) support for 300, 1200, 14400, and 28800 baud (see caveats), (b) added bool overflow() method to test whether an RX buffer overflow has occurred, and (c) tuned RX and TX for greater accuracy at high baud rates 38.4K, 57.6K, and 115.2K.
  4. minor bug fixes — add .o file and objdump.txt to zip file for diagnostics.
  5. etracer’s inline assembler fix to OSX avr-gcc 4.3.0 interrupt handler bug added.
  6. ladyada’s new example sketch, fix to interrupt name, support for 328p.
  7. etracer’s workaround is now conditionally compiled only when avr-gcc’s version is less than 4.3.2.
  8. 8 MHz support and flush() and enable_timer0()  methods added
  9. digitalread/write scrapped in favor of direct port I/O.  Revised routines now get perfect RX up to 57.6K on 16MHz processors and 31.25K on 8MHz processors.
  10. inverted TTL signalling supported.  20MHz processors supported.  Teensy and Teensy++ supported.  New end() method and destructor added to clean up.
  11. added listen() method to explicitly activate ports.
  12. warn users about 1.0 conflict

Acknowledgements

Many thanks to David Mellis, who wrote the original SoftwareSerial, and to the multi-talented ladyada, whose work with AFSoftSerial is seminal.  Ladyada also provided the “Goodnight, moon” example sketch, fixed a problem with the interrupt naming (see v6) and tested NSS with the 328p.

Thanks also to rogermm and several other forum users who have tested NewSoftSerial and given useful feedback.

The diligent analysis of forum user etracer yielded the root cause of a tricky problem with NSS on OSX.  A bug in avr-gcc 4.3.0 causes the compiler to fail to generate the proper entry and exit sequences for certain interrupt handlers.  etracer identified the problem and provided an inline workaround.  etracer’s fix is in NSS 5.

User jin contributed a large body of work based on NSS and identified a potential problem that could result in data loss (fixed in NSS 5).  jin also made a variant of NSS that supports 4-pin serial, with the additional pins providing a very nice RTS/CTS flow control.  We may see this in NSS in the near future.

Thanks to Garret Mace, who contributed the delay tables for 20MHz processors and claims that he can send and receive at 115K baud.  Cool!

Thanks to Paul Stoffregen, both for his fine work with Teensy and Teensy++, and for contributing some useful suggestions that help NewSoftSerial run on them without modification.

I appreciate any and all input.

Mikal Hart

Page last updated on July 3, 2013 at 7:37 pm
646 Responses → “NewSoftSerial”

  1. Mike

    12 years ago

    Hi

    Has anyone experience problems with the newSoftSerial library ceasing to read serial data after a call to analogRead() has been made?

    If I comment out, the analog call everything works as it should do.

    Regards

    Mike


  2. Paddy

    12 years ago

    Hi

    I’m having difficulties reading data using newsoftserial. Board is a mega, pin 42 conected to 16, 43 to 17.
    Output is:
    10
    My_nss.read=-1
    Serial2.read=65
    repeating


  3. Mikal

    12 years ago

    Paddy, you can only use Mega pins that support pin change interrupts, and none of the four your mention do. Get the new beta version of NSS 11 and change your wiring to use one of the supported pins.


  4. macsimski

    12 years ago

    is it possible to make the buffer bigger? I was looking in the source, but could not find the place where to or how to do that. i am working on a improvement so you can select 8n1, 7e1, or any arbirtary combination of databits, parity and stopbits and speeds down to 50 BAUD. (remember telexes?)


  5. macsimski

    12 years ago

    found it. buffer settings are in the headerfile…


  6. Sam

    12 years ago

    Hi. I’ve a question about NewSoftSerial10: im’trying to use it for communication between two arduinos but when I read on Serial monitor the characters that I’ve send with anther Serial monitor, I only read “J” with two points over. Why?


  7. Serveurperso

    12 years ago

    Nice work, I need non-standard baud rate:( I need to calculate the DELAY_TABLE values for 100000 bauds on 16MHz 328 Arduino…


  8. Mikal

    12 years ago

    @Sam,

    Make sure you check to make sure a character is available before you try to read:

    if (nss.available())
    c = nss.read();

    You are probably getting a -1 return code, which means “no character available”.

    Mikal


  9. Mikal

    12 years ago

    You can usually support non-standard baud rates by interpolating the values that are already in the table. Be careful about high speeds like 100K baud though. At that speed things get pretty fragile on the poor little Arduino.

    M


  10. Oli

    12 years ago

    Hey,

    I got a little Problem running this library using Linux, although
    it works fine using Windows7:

    In file included from /home/b52/Projekte/Arduino/libraries/NewSoftSerial/NewSoftSerial.cpp:40:0:
    /home/b52/Projekte/Arduino/hardware/arduino/cores/arduino/pins_arduino.h:66:48: error: variable ‘port_to_mode_PGM’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
    /home/b52/Projekte/Arduino/hardware/arduino/cores/arduino/pins_arduino.h:67:49: error: variable ‘port_to_input_PGM’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
    /home/b52/Projekte/Arduino/hardware/arduino/cores/arduino/pins_arduino.h:68:50: error: variable ‘port_to_output_PGM’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
    /home/b52/Projekte/Arduino/hardware/arduino/cores/arduino/pins_arduino.h:70:54: error: variable ‘digital_pin_to_port_PGM’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
    /home/b52/Projekte/Arduino/hardware/arduino/cores/arduino/pins_arduino.h:72:58: error: variable ‘digital_pin_to_bit_mask_PGM’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
    /home/b52/Projekte/Arduino/hardware/arduino/cores/arduino/pins_arduino.h:73:55: error: variable ‘digital_pin_to_timer_PGM’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
    /home/b52/Projekte/Arduino/libraries/NewSoftSerial/NewSoftSerial.cpp:94:34: error: variable ‘table’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’

    avr-gcc: 4.6.1
    avr-libc: 1.7.0

    I got the same problem using NSS 11 beta :/

    Hope someone can help, thanks in advance
    Oli


  11. wolf

    12 years ago

    Hi! I try to fetch an website using NewSoftserial. My problem is, that there is a big header, and about 800 bytes are transmitted. I am interessted in the data after about 300 characters. I changed the buffersize to 256 in NewSoftserial, but that is still too small and I do not have any more memory in my ATMega left.

    Is there a trick, to get all the characters from the website? At the moment I tried to get about 40 chars and then I send a flush(). This enables me to get the section, which I am interessted in. But that’s not a very good way.

    Are there any plans to implement an FIFO buffer?

    Thank you!
    Wolf


  12. Mikal

    12 years ago

    Wolf, the NSS buffer *is* a FIFO.

    You could ignore the first 300 bytes of a stream using a simple technique like this:

    for (int i=0; i<300; ++i)
    {
    while (nss.available()); // wait until character arrives
    nss.read(); // throw it away
    }


  13. Rei Vilo

    12 years ago

    How easy / difficult to port the NewsoftSerial library to the Microchip-based chipKIT UNO32 Arduino-compatible board?

    See
    http://www.chipkit.org/forum/viewtopic.php?f=6&t=303&hilit=newsoftserial
    and
    http://www.chipkit.org/forum/viewtopic.php?f=6&t=281&hilit=newsoftserial


  14. Manfred

    12 years ago

    Hello!
    nice work, but I found a small problem in version 10C:

    In function setTX you set the pin to output before you set it to HIGH,
    this creates a short glitch on the TX pin to LOW.
    Change the order to:
    digitalWrite(tx, HIGH);
    pinMode(tx, OUTPUT);
    ,this will solve it.

    After this change I can connect correctly to an autobauding device.
    (don’t forget the pullup resistors with such devices).
    Manfred


  15. Mikal

    12 years ago

    @Manfred,

    Interesting. Your proposal makes some sense. It goes against conventional programming style, but I see your point. Thanks for sharing.


  16. David

    12 years ago

    How goes the CTS/RTS implementation?

    I’ve got a 328 on a board with a Max232(clone) and I’m banging away at 4800 bps after upping the receive buffer to (I think) 256 bytes. I threw in a CTS toggle to get it to work at 9600, but it’s not in the interrupt service routine. So now, as I’m coding along, I keep thinking… “When will I get back here? Will I lose bytes?”

    Anyhoo…
    Is the receive buffer empty when buffer_head == buffer_tail?
    If so, I could probably modify the .cpp source to lower CTS if the buffer’s empty, and raise it if the buffer’s full… (Just stick another pin in the constructor, I’m thinking…)
    I’m not worried (at the moment) about overflowing the 16550 in the PC with data coming from the 328, but I am worried about bits coming in and going to nirvana.


  17. Ugo

    12 years ago

    Hi,
    I am a very newby on arduino & related.
    I am working with an arduino UNO, a window XP netbook and, finally with a 232-to-USB converter (tested two different brands).
    I simply make a test with your basic example modified in this way:

    quote
    ——
    #include

    NewSoftSerial mySerial(2, 3);

    void setup()
    {
    // set the data rate for the NewSoftSerial port
    mySerial.begin(4800);
    }

    void loop() // run over and over again
    {
    mySerial.println(“Hello, world?”);
    delay(1000);
    }
    ——-
    unquote

    What I receive is a set of unreadable characters only.
    (Yes, I set the correct baud rate on monitor).

    Which could be the problem?
    Thanks in advance,
    Ugo


  18. wibauxl

    12 years ago

    Hi Mikal,
    Very nice work indeed !
    Just a small question after reading your code: what is the purpose of enable_timer0 ? It does not seem to be called from anywhere ?
    Laurent


  19. Rei Vilo

    12 years ago

    Hi!

    Do you plan to be ready for Arduino 1.0 IDE and the new Arduino Due board?

    Best regards,


  20. Marcos

    12 years ago

    Hi…I just add some code to handle the enable pin on RS485 systems and I want to share it…how can I send you for review it…I already tested (OK) but is always better to have a second review…thanks for the code…


  21. erik

    12 years ago

    Mikal, Using the newsoftserial demo with my GPS, I receive data well at 4800bps, but when the data rate is increased to 9600, I start losing characters, and 19200+ is unreadable. The GPS data signal is clean because I can read it with the HW serial port just fine up to 115200. I’m running a Duemilanove ATmega328 16mHz, serial input on pin 7. What could be the problem?


  22. Victor

    12 years ago

    Hello,

    As I understand it, NewSoftSerial gives other pins serial functionality between the Arduino and other devices. Is it possible to allow serial communication between Arduino and computer via USB using pins other than D0,D1 on an UNO? I have a shield that uses those pins to communicate with the Arduino, but I’d like to be able to type in input simultaneously.

    Thank you,
    Victor


  23. Mikal

    12 years ago

    @David,

    I don’t have time to make an RTS/CTS, but I know people have done this successfully. Yes, the buffer is empty when buffer_head == buffer_tail.

    BTW NewSoftSerial is migrating into the Arduino core with 1.0, renamed “SoftSerial”.

    Mikal


  24. Mikal

    12 years ago

    @Ugo,

    Arduino pins use TTL logic levels, not RS-232. You would need a TTL-to-USB converter.

    Mikal


  25. Mikal

    12 years ago

    @wibauxl,

    enable_timer0() is a technique for improving accuracy at very high baud rates where the timer tick attached to timer 0 can skew the data. It’s very rarely used, and will be abandoned completely once Arduino 1.0 comes out.

    Mikal


  26. Mikal

    12 years ago

    @erik,

    The only think I can imagine is that you are doing too much processing in between serial port reads and this causes you to lose characters. Does nss.overflow() return true? If so, then that’s your problem.


  27. Mikal

    12 years ago

    @Victor,

    Yes, but you’d need a TTL-to-USB converter/adapter.

    M


  28. Dmitry

    12 years ago

    I want to compile the program (for example NewSoftSerialTest) to ATMega32, but am getting syntax errors:

    C:\arduino-0022\libraries\NewSoftSerial\NewSoftSerial.cpp: In static member function ‘static void NewSoftSerial::enable_timer0(bool)’:
    C:\arduino-0022\libraries\NewSoftSerial\NewSoftSerial.cpp:520: error: ‘TIMSK0′ was not declared in this scope
    C:\arduino-0022\libraries\NewSoftSerial\NewSoftSerial.cpp:526: error: ‘TIMSK0′ was not declared in this scope

    And indeed, in the ATMega32 no TIMSK0, and there are TIMSK. May be there is a simple solution to this problem?


  29. Mikal

    12 years ago

    @Dmitry,

    That enable_timer0 is an experimental function to help tune very high baud rates. You can safely remove it.

    Mikal


  30. Magnus

    12 years ago

    Hi
    I tried using this library on an atmega8 using the atmega8_noxtal bootloader. For some reason I am not receiving anything at all, when connected to a gps. I have checked the wires and confirmed that everything works if I use a atmega328. Does anyone know what could be wrong when using the atmega8? (I am using the Timer connected to the TCCR2 register for interrupts)

    best
    Magnus


  31. Chab

    12 years ago

    Hello,

    Is it possible with this library to set PARITY, BIT STOP, etc…. on different inputs ?
    And how ?

    Thank you very much !
    Chab.


  32. varn

    12 years ago

    Hi,
    I am newbie to the newSoftSerial library, how can I find the documentation for any of the functions defined in the library ?
    Regards,
    Varn.


  33. Sisco

    12 years ago

    Hi very nice work very impressive.

    I try o use iwith Pololu Micros Servo controler (work nice alone) But when i try to use a second newsoftserial for my gps em406 then servos are jitters.

    An idea?

    Regards

    Sisco


  34. Charles

    12 years ago

    Mikal,

    May I ask where you are with adding parity to NewSoftSerial?


  35. Jorge

    12 years ago

    Hi Mikal,
    just a quick question, is it possible to set the NSS to use arduinos ANALOG ports as RX & TX? I don’t want to share the serial TX/RX with GPS TX/RX and almost all of my Digital PIN are used.

    Thank you!!!


  36. Jorge

    12 years ago

    It worked, just tried the analog ports A0 and A1 following the Digital sequence, once all ports on the atmel are digital, until you tell then they are not.
    I’m using now 14 and 15 pins for RX, TX.

    Thanx!!


  37. Luis

    12 years ago

    Hi there,
    This library works very well, while I’m not handling the output.
    But as soon as I try to develop some code around it (string manipulation, a couple of additional interrupts and whatnot), I start to get a lot of buffer overflows.

    For instance, with a GSM module I’m not being able to read and process a full 160 char SMS.

    I tried to change the buffer to a higher value and also lower the baud rate to 2400 and 4800, but my Arduino behaves erratically when I do any of those, and even freezes most of the time.

    So I’m at a loss here on what I could do to get around this. When receiving an SMS, I need to get the sender’s phone number and message content, that’s easy with strings, but perhaps messing around with strings causes too much delay in the MCU?

    Thanks in advance for your attention.
    Luis


  38. Luis

    12 years ago

    Hello again,
    Regarding my previous post, I believe the errors were due to bad programming on my part.

    To read the characters, I was using:
    // —————-
    char c;
    int dataAvail = sftwr_serial.available();
    if (dataAvail > 0)
    {
    for(int i=1; i 0)
    {
    c = sftwr_serial.read();
    }
    // —————

    At least this modification and setting the buffer to 256 bytes has been working for an hour now, without hiccups :)
    Lowering the baud rate continued to result in strange behavior, however.

    Thanks again!
    Luis


  39. Jay Emell

    12 years ago

    Hi,
    On the topic of multiple instances:
    I have a project that is about combining three, to perhaps four, 4800 baud input streams to one combined 38,400 baud output stream. The 4800 baud input streams are spiky – each transmit some 20 – 100 characters every second and are silent in between. The inputs cannot be synchronised and so will eventually transmit simultaniously at occasions.
    Given an Arduio Uno: Do you believe there is a solution to both use the HW USART in combination with two or three instances of NSS?


  40. luis

    12 years ago

    Hi! congratulations for this library,
    Have you ever proved this library with AtTiny’s using the Arduino plattform (software and hardware) as a programmer?


  41. Mikal

    12 years ago

    @Magnus,

    I don’t think the atmega8 has the necessary interrupt change pins to support RX with NSS.

    Mikal


  42. Mikal

    12 years ago

    @Chab,

    Sorry, no. I’d welcome a patch! :)

    Mikal


  43. Mikal

    12 years ago

    @Sisco,

    Have you tried the PWMServo library? NewSoftSerial is not compatible with the Arduino Servo library.

    Mikal


  44. Mikal

    12 years ago

    @Charles, honestly I doubt I will ever add parity to NewSoftSerial. Perhaps now that it’s heading to the Arduino core (as SoftwareSerial replacement) it will be easier to get someone to work on that.


  45. Mikal

    12 years ago

    @Jay,

    There is no way that you can handle *all* the data from each of the three 4800 baud ports. The best you can do is handle one port for 2+ seconds or so, then shift to the next one and cycle between them similarly.


  46. Klaus

    12 years ago

    Hi, I might be too tired to find it at the moment, or just stupid, but… is there anywhere a documentation of the functions & argument supported by NewSoftSerial? Or is it just looking through examlpes and the C++ source code?

    Regards, Klaus


  47. Pent R.

    12 years ago

    Did the “write” function at one point take in a pointer (uint8_t*) and a length? I recompiled some of my old code (from 4 months ago) using this library and it failed because my code was sending the write function a pointer and message length. I’m just a bit curious because it worked fine months ago.


  48. David

    12 years ago

    Is it possible to use NewSoftSerial to send data while simultaneously receiving data on a UART? I understand the Arduino UART can lose data if it arrives while I’m in an interrupt handler, and NewSoftSerial is interrupt-based.


  49. Lutorm

    12 years ago

    Thanks for your work on this, it’s a great addition! I’m having a weird problem, though. I’m reading data from a Matrix Orbital display at 19200. There is very little traffic. When I build my code on a Mac, with avr-gcc 4.5.3 and Arduino-0023, I get the expected results:

    23 2A 03 52 01 FF FF

    However, if I build the code on a PC, using avr-gcc 4.6.2 and Arduino-0023, I’m getting:

    23 AA 83 A8 80 FF FF

    Notice how it’s *almost* as if the packets after the first one have 0×80 added to them. The results are totally stable, so it’s not a one-off spurious thing. Do you have any idea what could cause one bit to “hang” like that?


  50. Justin

    12 years ago

    My 2c: I’m using it with an XBee Shield project, and Uno.
    It does work. That is good. The problem is that you definitely cannot send while receiving, the reception of the data is corrupted if it is sending.
    So you must carefully think about how you might want to use this for two-way communication.

93 Trackbacks For This Post
  1. NewSoftSerial 5 « Arduino

    [...] NewSoftSerial version 5 is available. A lot of people have been using this library — thanks! — but I really need to recognize the exceptional work of two contributors. [...]

  2. NewSoftSerial 6 « Arduiniana

    [...] I posted the new library. [...]

  3. เริ่มต้นสร้าง GPS จอสีกับอาดูอี้โน่ | Ayarafun Factory

    [...] ในรอบนี้ผมได้ใช้ newSoftwareSerial3 จะได้ลองด้วยว่า มีปัญหาไหม

  4. Unlogic » USB Storage and Arduino

    [...] of the first things to do is download NewSoftSerial

  5. The Hired Gun » GPS project: the Bluetooth saga

    [...] to the task at hand, which happened to be adding 3 lines of code: declaration of an instance of NewSoftSerial, calling the instance constructor with a baud rate, and a single call to pass the char from the [...]

  6. layer8 » Controlling A Roomba with an Arduino

    [...] and the XBee module has a serial interface.  So how does this really solve my problem?  Enter NewSoftSerial, an updated version of the Arduino software serial library, which basically lets you drive a serial [...]

  7. This and That » Blog Archive » Arduiniana - What else would it be?

    [...] is probably the coolest gift idea I’ve seen.  Mikal, you rock.  And also, thank you for NewSoftSerial.  [...]

  8. Interfacing the Arduino with the DS1616

    [...] way.  Let’s move onto the software.  Communication with the DS1616 is established using the NewSoftSerial library.  Getting data is essentially a case of lots of bit banging.  The DS1616 library [...]

  9. Serial Multiplexing « Interactive Environments Minor 2009-2010

    [...] So we started looking for a solution to overcome this tiny inconvenience. First we looked into a software serial but this didn’t work out, it was a bit too much for the arduino’s little processor to [...]

  10. Atmega/Arduino (Soft-) Serial Ports | Jochen Toppe's Blog

    [...] software serial port. I briefly thought about writing one, but then I found this great libary, the New SoftSerial. It is as simple to use as the original library, but unfortunately once I connect the RF receiver, [...]

  11. The Frustromantic Box, Part 4: Software « New Bright Idea

    [...] developers for the great libraries, and to Mikal Hart in particular for his work on the TinyGPS and NewSoftSerial [...]

  12. side2 » Bimeji Client for Arduino

    [...] このソースでは、PS2ライブラリとNewSoftSerialライブラリを利用しています。 コンパイルするには、これらのライブラリを有効にしておく必要があります。 [...]

  13. Live Twitter Table using New Bluetooth Shield | Club45

    [...] as a well. The shield can be wired to any of the pins on the Arduino. Right now we’re using NewSoftSerial on pins 4 and 5. It can be attached to the hardware RX and TX pins, but interferes with [...]

  14. tokyo->kobe->osaka << Motoi Ishibashi

    [...] 急遽、Arduinoでシリアル通信をふたつやる必要が発生してホテルで開発。といっても手元にハードがないので、ほとんど勘でプログラムしているようなもの。 次の日現場で試すも、予想通り動かない。そりゃそうだ。 NewSoftwareSerialなんていう便利なものがあるのを後で知った。 [...]

  15. VDIP1 USB Host Controller « Arduino Fun

    [...] chose the NewSoftSerial library to give access to the VDIP1.  The first attempt was to use the AFSoftLibrary and it just [...]

  16. Project Lab

    [...] software running on the Arduino ATMEGA328 chip utilizes the wonderfully robust NewSoftSerial library for communicating with the EM-406a GPS module and the very convenient TinyGPS library for [...]

  17. Box Round 2 « Stromberg Labs

    [...] is available here. I borrowed from a couple of people’s Arduino libraries to get this done, notably NewSoftSerial from Arduiniana and the GPS Parsing code from the Arduino website for parsing the NMEA strings. [...]

  18. Grok Think » Blog Archive » I got Arduino sending temp to the computer using xbee wireless.

    [...] I had to use this library to communicate with the xbee from the arduino:  http://arduiniana.org/libraries/newsoftserial/ [...]

  19. GPS – Welcher Chip? | Ranzow im Umbau

    [...] wird über die Serielle Schnittstelle angesteuert. Die werde ich wahrscheinlich über die NewSoftSerial Library [...]

  20. GPS – Welcher Chip? | Ranzow im Umbau

    [...] GPS Modul wird über die Serielle Schnittstelle angesteuert. Die werde ich wahrscheinlich über die NewSoftSerial Library [...]

  21. Cititor RFID 125KHz « Tehnorama

    [...] metoda de a afla codul cartelei este de a utiliza biblioteca NewSoftSerial, disponibila gratuit aici. Fisierul zip se dezarhiveaza si se copiaza in folderul libraries al distributiei [...]

  22. Lightweight software UART -> custom serial « Robotics / Electronics / Physical Computing

    [...] updated the NewSoftSerial library from Arduiniana (thanks Mikal !) so that it takes 2 extra [...]

  23. Control Camera with Arduino | SenSorApp

    [...] http://arduiniana.org/libraries/newsoftserial/ [...]

  24. GPS testing with LCD Character Display

    [...] the TinyGPS library from Arduiniana downloaded and installed for it to work. They suggest using NewSoftSerial, but I couldn’t get that to work, so I scrapped that portion. Here’s my [...]

  25. #Rallylog Fusebits

    [...] it as a fail and moved on, however last night when I set about writing the RFID read function using NewSoftSerial on the RFID I was getting nothing reported back back on the AVR, not a thing coming back from the [...]

  26. 433 MHz receiver and NewSoftSerial at mitat.tuu.fi

    [...] http://arduiniana.org/libraries/newsoftserial/ http://www.sparkfun.com/commerce/product_info.php?products_id=8950 [...]

  27. Moving Forward with Arduino – Chapter 17 – GPS « t r o n i x s t u f f

    [...] devices. At this point you will need to install two libraries into the Arduino software – NewSoftSerial and TinyGPS. Extract the folders into the libraries folder within your arduino-001x [...]

  28. Moving Forward with Arduino – Chapter 17 – GPS « Hey it’s my blog…

    [...] this point you will need to install two libraries into the Arduino software – NewSoftSerial and TinyGPS. Extract the folders into the librariesfolder within [...]

  29. Sonar | Starter Kit

    [...] there is one more library – “NewSoftSerial”, which is free of these defects and, in addidion, handles inverted serial [...]

  30. Advanced RFID with Arduino and Python! | App Delegate Inc

    [...] NewSoftSerial [...]

  31. RFID Door Opener – Update 3 – LCD Woes - Sommineer

    [...] one on some other pins.  Per the suggestion of some people on the Arduino forums, I decided to use NewSoftSerial to do the communication.  Being interrupt driven, it was much more efficient than the older [...]

  32. keyHelper final project

    [...] the code you will need a very useful NewSoftSerial library, that, among other things, allows you to assign TX and RX on other pins then 0 and 1 and that way [...]

  33. Step-by-Step Guide on using the Bluetooth Bee, Bees Shield & Arduino to communicate via bluetooth | Michael Chuah

    [...] up would be to try and use the awesome NewSoftSerial library by Mikal Hart to communicate with the Bluetooth Bee by emulating the UART [...]

  34. Tutorial: Arduino and GSM Cellular – Part One « t r o n i x s t u f f

    [...] a software perspective we will need the NewSoftSerial Arduino library, so please download and install that before moving [...]

  35. Interfacing Arduino to GSM shield | Embedded projects from around the web

    [...] goes step by step how to connect Cellular shield to Arduino mega and communicate to it by using newsoftserial Arduino library. Whole process steps are monitored in terminal window, so it is easy to follow [...]

  36. Fully functional Arduino GPS logger « Liudr's Blog

    [...] NewSoftSerial library [...]

  37. LCD117 Controller Library - Jack Kern

    [...] also need the NewSoftSerial library installed in your Arduino sketchbook’s library [...]

  38. Touch game for the offspring | NinjaTool inc.

    [...] GLCD that I bought (without knowing ANYTHING about it beforehand I might add). The code uses the NewSoftSerial library which apparently does wonders, but as of yet has not been validated as the code assumes a 9V [...]

  39. Arduino GSM and GPRS shield | Open Electronics

    [...] the pin 4 and 5 there aren’t problems to upload the sketch but the maximum baudrate for NewSoftSerial (the serial library) is 57600. We performed a GSM library to controll easly the module. The GSM [...]

  40. Moving Forward with Arduino – Chapter 19 – GPS part II « t r o n i x s t u f f

    [...] forget the 10k ohm pull-down resistor). You will need to install the SdFAT library, NewSoftSerial library, TinyGPS library and the SdFat library if not already [...]

  41. Blog What I Made » YAHMS: Base Station

    [...] of just the standard Serial interface, see the links below for that too. You’ll also need NewSoftSerial of course and the Flash library which I’ve used to decrease memory usage. Follow the [...]

  42. Infovore » Nikon D-Series Intervalometer

    [...] a single wire, which again, keeps the number of wires from the Arduino down. I’m using the NewSoftSerial library to talk to it, which makes life [...]

  43. Arduino Experiments

    [...] you can use multiple serial “ports”, that are actually digital I/O lines, by using the NewSoftSerial library. This works exactly like the Serial library, but you can read from multiple pins, as long as you [...]

  44. EasyTransfer Arduino Library « The Mind of Bill Porter

    [...] it’s easier to pick which Serial port to use; Serial, Serial1, etc. AND support for the NewSoftSerial library for creating software serial ports on any pin. Inside the download zip file are two versions of the [...]

  45. Research: RFID, XBee and Arduino « Beyond the keyboard

    [...] neat thing is the NewSoftSerial library for Adruino, allowing you to turn any set of pins into additional RX/TX pins with free to set baud [...]

  46. jomuoru weblog » Blog Archive » Esto es Camus Party

    [...] de instalar la librería NewSoftSerial pude compilar e instalar el Arduino Firmware en mi placa. A continuación necesitaba descargarme [...]

  47. Update: Design review « Appiphania

    [...] a bit of this code at the end of this journal entry. The “NewSoftSerial” library http://arduiniana.org/libraries/newsoftserial/ was extremely easy to get working (code example [...]

  48. Anonymous

    [...] Modul per Software-UART? Bitte einen Link oder Hinweis wo ich nachlesen kann. danke Schaust du hier __________________ FHZ1300 | 2x JeeLink | AVR-NETIO | FS20 | 1-Wire | 2x XBEE Pro | 4x XBEE 2.5 [...]

  49. Using A Second (Software) Serial USB To Debug Your Arduino | Utopia Mechanicus

    [...] actually really easy, using some code called NewSoftSerial (available from this site, at the ‘Download’ subheading). This software is much like your Serial device you use on the Arduino, but it’s in software [...]

  50. Kemper LED / Arduino Interface » Powerhouse Electronics

    [...] provided by the software library “NewSoftSerial”. The library can be downloaded from:: http://arduiniana.org/libraries/NewSoftSerial/. Since the communications port is created using software any of the Arduino port pins can be used. [...]

  51. Android talks to Arduino | ★ Elmindo Blog ★

    [...] NewSoftSerial library from Mikal Hart: http://arduiniana.org/libraries/newsoftserial/ [...]

  52. Utilizando a Bees Shield em uma Arduino Mega « A arte do hardware

    [...] via jumper na própria shield. Para comunicação com essa Bee, é necessário o uso da biblioteca NewSoftwareSerial, permitindo fazer que dois pinos digitais se tornem mais uma [...]

  53. Arduino camera and geotagger | jarv.org

    [...] NewSoftSerial lib was used for communicating over serial using an IO [...]

  54. Bluetooth + Arduino + Android – 1 : Transmettre des données d’un capteur branché sur une carte Arduino vers un Smartphone Android via bluetooth

    [...] 1– télécharger la bib­lio­thèque New­Soft­Se­r­ial pour Arduino NewSoftSerial10c.zip. Des expli­ca­tions et exem­ples plus détail­lés con­cer­nant cette bib­lio­thèque sur cette page (http://arduiniana.org/libraries/newsoftserial/). [...]

  55. Arduino + fon + OpenWRT + ser2net + NewSoftSerial « sea side she side

    [...] そのためソフトウェアシリアルを再現させたライブラリがありますのでそれを利用します。とはいっても標準ライブラリのSoftwareSerialは利用しません。高機能で速度もでるようになったNewSoftSerialを利用します。 [...]

  56. David C. Dean Arduino GPS – On the Cheap

    [...] NewSoftSerial Library - http://arduiniana.org/libraries/NewSoftSerial/ [...]

  57. Telemetry Using Xbee Modules | Anacortes RC Sailors

    [...] arduino remotely can be found here. For communication over XBee the Arduino appears to need the NewSoftSerial library. LD_AddCustomAttr("AdOpt", "1"); LD_AddCustomAttr("Origin", "other"); [...]

  58. NewSoftSerial, Attachinterupt() and Pins 2,3 | Anacortes RC Sailors

    [...] for attacheinterupt() are 2 and 3. The GPS shield uses digital 2 and 3 for GPS communication using NewSoftSerial. So I tried moving the GPS to other pins, 8 and 9 worked. Now pins 2 and 3 are free for my [...]

  59. Telemetry Using Xbee Modules | Anacortes RC Sailors

    [...] arduino remotely can be found here. For communication over XBee the Arduino appears to need the NewSoftSerial library. [...]

  60. [Arduino] Lecteur RFID à écran lcd, avec stockage du tag “valide” en EEPROM externe I2C « Skyduino – Le DIY à la française

    [...] Dans ce projet vous pouvez remarquer que je suis obligé d’utiliser deux port série, un à 9600 bauds pour l’écran lcd, et un autre à 2400 bauds pour le lectuer RFID. Normalement il me faudrait une mega (qui possède 3 port série) pour faire ce projet en hardware, mais il existe aussi des librairies Serial software ! C’est pourquoi je vais utiliser la librairie NewSoftSerial disponible ici : http://arduiniana.org/libraries/newsoftserial/ [...]

  61. An Idiot and an Arduino: Pretty WiFly for a White Guy « ~jmoskie

    [...] went through each error, and tried to resolve it myself. Some were easy. The "NewSoftSerial" libraries were incorporated into the core libraries, and they replaced the default SoftwareSerial [...]

  62. Arduino vs Arduino Mega – Which To Use? | Utopia Mechanicus

    [...] speed if you need a second or third (or fourth) port. On the Uno, you can do similarly using the NewSoftSerial library; however, software is slower, and if your program is pushing the limits, you may find a hardware [...]

  63. I can solder! 7-Segment Serial Display & Nunchucky operational « I Am Chris Nolan.ca

    [...] already.  I found this wall of text which I managed to digest down into this gist (and updated it thanks to these notes) which you can see running in the above [...]

  64. S2 » Android + Bluetooth + Arduino

    [...] そして、シリアル通信のテストに利用したArduinoのソースです。 NewSoftSerial(Arduinoライブラリ)を利用しています。 [...]

  65. Getting started with DroneCell and Arduino.

    [...] DroneCell and the GPS simultaneously. I stumbled upon this interesting behavior in NewSoftSerial. NewSoftSerial*|*Arduiniana. I seem to at least have something to go on… Using Multiple Instances There has been [...]

  66. Emular pines Serial de Arduino con la librería NewSoftSerial » Blog Archive » el blog de giltesa

    [...] eso es lo que es capaz de hacer la librería NewSoftSerial (más documentación aquí). Usándola podremos emplear el resto de pines como puertos serial, ya [...]

  67. Time - He's waiting in the wings - Cuyahoga

    [...] in the download is TimeGPS.pde, but it’s a touch outdated now that Mikal Hart’s NewSoftSerial library has been rolled up into the core (since 1.0) and renamed SoftwareSerial. The problem I had [...]

  68. Arduino的通讯扩展板介绍 | 爱板网

    [...] GPS模块与Arduino的通讯程序 [...]

  69. Giving Arduino a second UART over I2C by stacking another Arduino on top « CyclicRedundancy

    [...] tried using the SoftSerial (or the NewSoftSerial) library but ran into data corruptions even at the low speeds, so I decided to look for ways to get another [...]

  70. RFID Reader #1 « Tesla UIs

    [...] the example code. There some issues on the Arduino library SoftwareSerial, which changed to the NewSoftSerial once in a while. Share this:TwitterFacebookLike this:LikeBe the first to like this. Categories [...]

  71. Resources for the VCNL4000 IR Proximity Sensor | Sciencearium

    [...] - http://arduiniana.org/libraries/NewSoftSerial/ Share this: This entry was posted in AT Physics Class and tagged arduino, IR, proximity [...]

  72. Serial LCD do-it-yourself(DIY) kit | BUILD CIRCUIT

    [...] NewSoftSerial Library - Required for the example sketches. Sets up a second (third, fourth,…) serial port on the Arduino. [...]

  73. How to assemble serial LCD kit | BUILD CIRCUIT

    [...] NewSoftSerial Library - Required for the example sketches. Sets up a second (third, fourth,…) serial port on the Arduino. [...]

  74. Android talks to Arduino board - Arduino for ProjectsArduino for Projects

    [...] from this project (bluetooth_chat_LCD.pde attached below) – NewSoftSerial library from Mikal Hart: http://arduiniana.org/libraries/newsoftserial/ – Eclipse – Android Development Kit (explicitly follow all of Google’s installation [...]

  75. Burn Arduino Bootloader on an ATtiny45 for SoftwareSerial | No bread? Make it!

    [...] http://arduiniana.org/libraries/newsoftserial/ いいね:いいね 読み込み中… カテゴリー Arduino, [...]

  76. Burn Arduino Bootloader on an ATtiny for SoftwareSerial | No bread? Make it!

    [...] http://arduiniana.org/libraries/newsoftserial/ いいね:いいね 読み込み中… カテゴリー Arduino, [...]

  77. Please wait your turn! Stratoballoon GPS Sensor Sketch « Mark Gilbert's Blog

    [...] to the GPS receiver, I’d be writing to the data logger serially.  I found information here about running multiple devices serially – the short answer is that you have to access the serial [...]

  78. Going to Arduino from C#, Java, … string trouble | Hydroinformatix the Gaul

    [...] kB). I used this method and solved my intermitting (and making me crazy…) problems 2) Using PString library, added by NewSoftSerial and put in official version of Arduino. It is very handy: it hands you a [...]

  79. The Frustromantic Box, Part 4: Software | New Bright Idea

    [...] developers for the great libraries, and to Mikal Hart in particular for his work on the TinyGPS and NewSoftSerial [...]

  80. Le Dan-TECH » 2ème Partie : Reconnaissance vocale avec Arduino

    [...] , les ports 12 & 13 de l’arduino sont utilisés (liaison arduino-module via la classe newSoftSerial) et ne permettent pas l’emploi du shield Ethernet sur une platine « arduino [...]

  81. on the trail of the elusive Power Cost Monitor signal | We Saw a Chicken …

    [...] I rewrote the logger to use the Arduino’s internal UART, since — lovely though NewSoftSerial may be — it causes millis() to report wildly inaccurate times at low bit rates. I recorded a [...]

  82. 86duino

    [...] require that protocol. The version of SoftwareSerial included in 1.0 and later is based on the NewSoftSerial library by Mikal [...]

  83. 86duino

    [...] This requires the TinyGPS and NewSoftSerial libraries from Mikal Hart: http://arduiniana.org/libraries/TinyGPS and http://arduiniana.org/libraries/newsoftserial/ [...]

  84. Kerry D. Wong » Blog Archive » RF Data Link Using Si4021 And Si4311

    [...] BT1 pin settings (which are done in hardware), the receiver is totally configuration free. I used NewSoftSerial library in the code below. The main loop simply print out the incoming bit stream. You may also use [...]

  85. how to set up arduino + pololu mini maestro (for an 18 servo hexapod) | orange narwhals

    [...] newsoftserial should be downloaded from the internet and the folder inside the zip put in (path to where you [...]

  86. Starter Kit Sonar » Starter Kit

    [...] szczęście jest jeszcze jedna biblioteka „NewSoftSerial”, która jest pozbawiona tych wad i na dodatek obsługuje zanegowany sygnał [...]

  87. Twitter Poem Box -Use Arduino for Projects

    [...] Download the TrueRandom http://code.google.com/p/tinkerit/wiki/TrueRandom, NewSoftSerial http://arduiniana.org/libraries/newsoftserial/, and Twitter [...]

  88. Подключение GPS L30 модуля используя GPS Шилд от SparkFun » Arduino Market

    [...] NewSoftSerial [...]

  89. Tema 5 – Proyectos Arduino | Aprendiendo Arduino

    [...] NewSoftwareSerial: http://arduiniana.org/libraries/newsoftserial/ [...]

  90. Twitter Poem Box -Arduino for Projects

    [...] Download the TrueRandom http://code.google.com/p/tinkerit/wiki/TrueRandom, NewSoftSerial http://arduiniana.org/libraries/newsoftserial/, and Twitter [...]

  91. 아두이노의 통신 방법, 핀 정리 (Serial, UART, Software Serial, SPI, I2C) | Hard Copy Arduino

    [...] NewSoftSerial (Arduino IDE 1.0 이후 버전만 지원) – Serial 모듈별로 인스턴스를 생성해서 여러개를 사용할 수 있지만 한번에 하나의 인스턴스만 전송/수신 할 수 있습니다. 다른 라이브러리와의 충돌 가능성도 약간 있는 듯 합니다. http://arduiniana.org/libraries/newsoftserial/ [...]

  92. Please wait your turn! Stratoballoon GPS Sensor Sketch « Mark Gilbert's Blog

    [...] to the GPS receiver, I’d be writing to the data logger serially.  I found information here about running multiple devices serially – the short answer is that you have to access the serial [...]

  93. RFID cat door using Arduino -Use Arduino for Projects

    [...] This project consists of several ‘modules’ that you need to hook up to the Arduino and test in advance. First hook-up the RF reader. You can use the 5v output of the Arduino to power it, and a digital port (I used 2) to get the signal. The RDM630 that I used also has pins for a led that I don’t use. It also has an RX pin to send info back to the RF reader, but I don’t use that either. Hook-up your antenna, get a tag and use the serial monitor of the Arduino to see if it’s detected. Now you can also start working on improving the antenna by trying adding or removing turns, trying different shapes et cetera. Power the Adruino with the 9v power supply, not just USB because at least in my case that didn’t work. You can download the file named ‘rfid3.pde’ to test. The code requires NewSoftSerial.h which can be obtained here [...]

Leave a Reply