Shop OBEX P1 Docs P2 Docs Learn Events
Shiftout Problem — Parallax Forums

Shiftout Problem

A KrishA Krish Posts: 27
edited 2008-05-04 22:45 in BASIC Stamp
Hey Guys ...

I want to connect 2 indepenedent BS2 boards.

I have checked the help and used the command at BS2 "A":

Shiftout Pin No, Clk Pin, MSBFIRST, [noparse][[/noparse]Data]

At BS2 "B" I have used the code:

SHIftin Pin No, Clk Pin, MSBFIRST, [noparse][[/noparse]Received data]

Now my problem is .. when I give this command .. I always get a zero value at Bs2"A" and Bs"B".

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-04 02:51
    It won't work the way you want. In both cases (SHIFTOUT / SHIFTIN) the Stamp is the master and provides a clock to some other device to take or provide data. In your case, you may have damaged the clock I/O pins because they're both outputs and they may have been in opposite states (one HIGH and one LOW) which causes a short circuit. The way to connect two Stamps is with serial asynchronous I/O (SEROUT / SERIN). It's always a good idea to put a 150 Ohm or 220 Ohm resistor between the two Stamps when you connect I/O pins together. This will limit any short circuit current to something (25mA to 30mA) which the Stamp can withstand without damage.
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-05-04 22:42
    +1 Mike. SEROUT/SERIN is perfect for this.

    And the 220 ohm resistor between two different BS2's is also an excellent idea to reduce inadvertent damage.
  • A KrishA Krish Posts: 27
    edited 2008-05-04 22:45
    Thanx a lot ... I really needed this help .. once again thanx a lot ..
Sign In or Register to comment.