Author Topic: SoftSerial.h not working?  (Read 17790 times)

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: SoftSerial.h not working?
« Reply #15 on: January 02, 2015, 11:40:49 am »
In working on SoftSerial have you ever run Pro to Pro leaving Tx/Rx connected?  If you left one unit powered did that ever keep the other unit from powering down?  In doing my Serial Oled I got into a state where using the Programming Tool I cut power and on restoring power the device picked up where it left off and did not restart.

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: SoftSerial.h not working?
« Reply #16 on: January 02, 2015, 02:02:24 pm »
Another connection question:  In the day most things I did were different devices talking serially, and the cable connected and worked well.  Now I'm running two plug jumper wires from Pro Rx/Tx to Pro Tx/Rx.  I found that the connection is not reliable unless they run from the same power source, even adding a common ground alone didn't work - messages would be skipped or clipped.  This is with Hardware Serial - does any of this relate to your Pro usage or general connection details?

joelparks

  • Newbie
  • *
  • Posts: 2
Re: SoftSerial.h not working?
« Reply #17 on: January 03, 2015, 04:03:13 pm »
Technically you shouldn't expect serial comms to work unless the connection is 3 wires: tx, rx, and signal gnd.

If the two devices are sharing a power supply, then presumably (i.e. except when something more complex is designed in) they have a common ground and you may be able to get away with just two wires: tx and rx.  For this to be guaranteed reliable the two devices should be on the same PC board or on boards connected via headers, so the integrity of the ground plane is assured.

If the two devices are not sharing a power supply, then you would probably want to opto-isolate the tx and rx (and gnd) on the board you care most about (if not both) so that differing (floating) ground potential doesn't cause big problems.   You may be able to get away with enforcing a common ground, but then strange things happen with ground loops etc if there are other emf things going on nearby.
« Last Edit: January 03, 2015, 04:05:11 pm by joelparks »

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: SoftSerial.h not working?
« Reply #18 on: January 04, 2015, 01:17:10 am »
Thanks Joel - Indeed the stuff I worked with was industrial and had optical isolation where needed and was 422 for far away stuff and all grounded and secure.  You get none of that and less with wire tied to the side of a single chip MCU.  Even a ground wire between the two devices when powered uniquely is an invite to disaster.

For my current setup I have a healthy USB battery pack going to a hub that pushes out the power with no PC in the loop and then I hang a Pro on two ports and get really good results.  Only risk is leaving Rx/Tx connected when I program from the PC port.  I started with one pro wired to power the other, and that was fine until I put unique USB power on both it seems.

Making good headway with OLED+Serial debugger on this thread I'll repost since I'm enjoying it: http://digistump.com/board/index.php/topic,1638.0.html  Also the Debugger end as I have it might work well for a single wire host Pro as long as the Debugger knows when to stay read only.

digi_guy

  • Jr. Member
  • **
  • Posts: 87
Re: SoftSerial.h not working?
« Reply #19 on: January 16, 2015, 07:37:20 pm »
Success! ! !

You have no idea how happy you've made me.

Now if only I could remember why I didn't it in the first place...


digi_guy

  • Jr. Member
  • **
  • Posts: 87
Re: SoftSerial.h not working?
« Reply #20 on: January 18, 2015, 08:38:38 pm »
What are the limits for the digispark's memory? 

I've been using softserial along with Serial to have both the wifi and the bluetooth modules running on the same pro. Initially it seems like things were working, because I was sending one character at a time, similar to the softwareserial example on the Arduino site.

When I then tried to add softserial onto the server example things eventually stopped working and I couldn't get much to print out.

Any thoughts?

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: SoftSerial.h not working?
« Reply #21 on: January 18, 2015, 08:54:27 pm »
I just started this thread: Memory Usage on the PRO

http://digistump.com/board/index.php/topic,1667.0.html

It has what I've encountered in my usage.