Shop OBEX P1 Docs P2 Docs Learn Events
Stamp to stamp serial data susceptible to interference/static — Parallax Forums

Stamp to stamp serial data susceptible to interference/static

StuartttttStuarttttt Posts: 45
edited 2015-04-07 08:40 in BASIC Stamp
My latest project uses two BS2's and involves them sending data back and forth. I used the diagram in the BS2 serial help file and using the prog below the two stamps appeared to be communicating properly. The two BOE were only 6" apart. However when I installed them amongst the other project wiring (jpeg below) the data became corrupted. I found that even touching the data wire insulation would cause problems.

I have since used a screened and earthed cable for the data line and the data appears to be fine at the moment.
If the BS2 help information gets updated, would it be worth mentioning that the data line needs to be screened?

Stuart

'Stamp master
Value VAR Byte
Number VAR Byte

Main:
SEROUT 0\1, 16468, [Value]
Value = Value + 1
SERIN 0\1, 16468, 2000, No_Data, [Number]
DEBUG "Master ", DEC Number,CR
GOTO Main

No_Data:
DEBUG BELL
DEBUG " No data from Slave",CR
PAUSE 2000
GOTO Main



'Stamp slave ( 2nd BS2 code)

Value VAR Byte
Number VAR Byte

Main2:
SERIN 0\1, 16468, 2000, No_Data, [Value]
DEBUG "Slave ", DEC Value," ",CR
IF Number > 249 THEN Number = 0
SEROUT 0\1, 16468, [Number]
Number = Number + 50
DEBUG HOME
GOTO Main2

No_Data:
DEBUG BELL
DEBUG " No data from Master",CR
PAUSE 2000
DEBUG CLS
GOTO Main2
612 x 816 - 280K

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2015-03-26 08:30
    Its quite unusual to see an interference problem at such short distance even at that baudrate with the Stamps. Did you have all grounds ( 0v ) tied together? particularly the grounds of the two communicating Stamps.

    Do all of the relays have coil suppressors installed? ( probably a diode on the boards).

    Also, did the serial lines run physically in parallel with the leads driving the relay coils?.

    The shielded/earthed cable could mask any of the original issues.

    Cheers,
  • john_sjohn_s Posts: 369
    edited 2015-03-26 11:11
    Stuarttttt wrote: »
    ... I found that even touching the data wire insulation would cause problems...

    Place 100k resistors from both receiving ports to Vss and repeat your observations...
    Long time ago I tried the same in noisy environment and it helped.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2015-04-06 09:48
    I agree with stamptrol, there must be something unique about your circuit and/or programming that is causing this. This is not typical at that distance unless there are significant EMI/RFI considerations such as a solenoid or relay firing nearby.
  • G McMurryG McMurry Posts: 134
    edited 2015-04-06 17:18
    Stuart,

    Just load down the serial lines a bit. The stamp has a beefy driver. I'd try a 2K or so termination resistor on your serial lines. It can't hurt.

    Greg
  • StuartttttStuarttttt Posts: 45
    edited 2015-04-07 08:40
    Thank you all for your interest and suggestions.
    The relays coils do have suppression diodes although I did have the serial data line between the two stamps in parallel with all the stamp output signals. I have since re-routed the (thick grey) serial line on its own. (also left it screened) Photo attached.
    Also I have screened off the relay boards from the stamp BOE's.
    The main problem I believe (after prompting, ie "Its quite unusual to see an interference problem at such short distance" and "This is not typical at that distance unless there are significant EMI/RFI considerations" ) is that
    I was sitting on a chair on top of a 1 m2 plastic carpet protection mat. I was probably charged up with static. If I earthed myself before touching the serial line there was no problem.
    I have been testing stamp breadboard/ BOE circuits for several years and never had any problems before.
    I'm wiser now, thanks.

    Stuart
    612 x 816 - 319K
Sign In or Register to comment.