How many serial devices can I have attached to the arduino at the same time using softserial? Theres a limit or no?
Running multiple serial devices into the same 2 IO pins can create problems. However if you must use multiple serial devices and not at the same time, just use a simple mux. They're cheap, readily available at radioshack and essentially allow for you to select which serial device you'll need to read from.
If you need both input and output for the different serial devices 2 muxs may be needed. How many serial devices are you attempting to use and to what extent? With that I can probably help point you in a bit more specific direction. Best of luck!
Can I have arduino running at 9600 and add a another device via SoftSerial at 9600? So i can see both on the same debug window?
You can use the hardware UART and a software serial port, for example im using the hardware UART to talk to a phone and retrieve the time from it, and then using software serial to write that time to an LCD.
Though im not sure if you can run more than one software serial, the arduino might be too slow for that or not have enough ram.
Yes. Its called AFSoftware Serial
Lady Ada's got another version of it here:-
http://www.ladyada.net/make/eshield/AFSoftSerial.zip
But Im not sure if it includes the dual pin mod.
thanks..
but the question is..the hardware UART and the softserial can run at the same speed? 9600 or whatever
I currently have both running at 9600bps. Seems to be working OK.
I proposed AFSoftware serial for this question:-
Though im not sure if you can run more than one software serial
And yes, they both, UART and AFSS, can communicate at 9600
I don't believe AFSoftSerial can do multiple instances (yet), at least not for RX. There is some work afoot to fix this, but I believe the current edition of AFSoftSerial uses a static buffer for RX, which is shared between instances of the AFSoftSerial class.
Mikal
The claim at the site ( http://absences.sofianaudry.com/en/node/18 ) is:-
It thus allows to have several inputs/outputs (rx/tx).
If it can be clarified that would be good, otherwise I don't know why there would be two versions of the same library.
Yes, that sofianaudry version of AFSoftSerial is nicely rewritten to support multiple devices. Alas, something seems different with the timing. When I plug it in, the 4800-baud GPS unit I was using successfully with AFSoftSerial no longer sends me readable data (even with just 1 connection). I'm trying to figure it out.
Mikal