Shop OBEX P1 Docs P2 Docs Learn Events
prop talking to bs2 — Parallax Forums

prop talking to bs2

bigirvbigirv Posts: 37
edited 2011-12-14 17:48 in Propeller 1
What would be the best way to have a prop talk to a bs2 and vice versa? Figured I would mess around with this since i have the BS2 HW board. I already tried serin on the bs2 and the simple serial object on the prop, but the only thing that showed up on the bs2 debug terminal was a p then i changed the values and it was a q but there should have been at least 2 characters. Should I use a different com method?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-13 17:55
    You can connect a Stamp I/O pin to a Propeller I/O pin if you put a 2.2K resistor in series with the connection. This protects the Propeller I/O pin (3.3V logic levels) from the 5V logic levels of the Stamp I/O pin. On the BS2, you'd use SERIN or SEROUT. On the Propeller, you'd use FullDuplexSerial or Simple_Serial. Make sure the Bauds are the same. I'd suggest using 2400 Baud at first. You could use one I/O pin in each direction on each device for a full duplex connection.

    Remember that the BS2 and Simple_Serial on the Propeller are unbuffered. The receiving end has to be waiting for a character when the transmitting end actually sends something or the receiving end will miss it. FullDuplexSerial is buffered and doesn't have this problem when it receives. The BS2's serial I/O is never buffered.
  • pedwardpedward Posts: 1,642
    edited 2011-12-14 15:39
    FWIW, this 5v tolerant issue came up the other day and the proper value has been revised to 3.3k. The protection diodes on the prop are good for 500ua and require a 3.3k resistor to be 5v tolerant without stressing the protection diodes. Just thought I'd pass this along.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-14 16:50
    Let's see ... The diodes start conducting at about 0.6V (one diode drop) above Vdd which is normally 3.3V. That's 3.9V. The Stamp's Vdd is 5V. Maybe a Stamp I/O pin will reach Vdd, but more typically it will reach about 0.3V below Vdd which is about 4.7V. So 4.7V - 3.9V = 0.8V. By Ohm's Law, 0.8V / 0.5mA = 1600 Ohms. A 2K or 2.2K resistor will give plenty of leeway. A 3.3K resistor will give lots and lots of protection. Most digital power supplies are expected to be correct to within 10%. Worst case would have the Propeller's Vdd be 3.0V (3.3V - 10%) and the Stamp's Vdd be 5.5V (5.0V + 10%). That would give 5.5V - 0.3V - 0.6V - 3.0V = 1.6V. By Ohm's Law, you'd have 1.6V / 0.5mA = 3.2K. The next standard value is 3.3K.
  • pedwardpedward Posts: 1,642
    edited 2011-12-14 17:48
    Yeah, we had that discussion here: http://forums.parallax.com/showthread.php?136429-Ping-resistor

    Something I was thinking of the other day: If it only takes a 3.3k resistor on an input to make the Prop 5v tolerant, then why wasn't the input impedance made higher to begin with? I mean, in "input" mode it's supposed to be High-Z, which implies at least 100k. Based on the 3.3k requirement, it would imply that the protection diodes are place nearer to the I/O pins than the input circuitry. :frown:
Sign In or Register to comment.