Shop OBEX P1 Docs P2 Docs Learn Events
Breadboarding a Stamp MODULE — Parallax Forums

Breadboarding a Stamp MODULE

Bill ChennaultBill Chennault Posts: 1,198
edited 2007-09-20 20:08 in BASIC Stamp
All--

Is breadboarding a Stamp MODULE as easy as providing it with a regulated 5vdc power source and putting together the RS232 connector using physical Stamp pins 1, 2, 3, and 4?

--Bill

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.

Comments

  • Steph LindsaySteph Lindsay Posts: 767
    edited 2007-09-17 22:34
    There's a schematic on page 28 (pdf page 32) of the BASIC Stamp Manual that might be useful to you:

    http://www.parallax.com/dl/docs/prod/stamps/web-BSM-v2.2.pdf

    -Stephanie Lindsay

    Editor, Parallax Inc.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-17 22:44
    Stephanie--

    Does regulated, +5vdc go to VDD and ground to VSS?

    Thanks!

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Max WoodenMax Wooden Posts: 112
    edited 2007-09-17 22:53
    Bill, yes you are correct, 5VDC on VDD and ground VSS.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Max Wooden
    Reedley, California
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-17 23:00
    Max--

    Gee. That might solve a problem for me. (In any case, it will be a lot of fun!)

    Do I just look online for the power regulator? If I want to run multiple Stamp MODULES on the same breadboard, is it more or less feasible to size ONE power regulator for the total number of Stamps on the breadboard, or to use seperate LM2940-5.0 regulators?

    Thanks . . . a lot!

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Max WoodenMax Wooden Posts: 112
    edited 2007-09-17 23:16
    You should be fine with just one regulator. If you don't have a LM2490 you can order one from DigiKey or even sample one for free from National Semiconductor. I would recommend putting a 1000uF capacitor between the output and ground to filter the supply.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Max Wooden
    Reedley, California
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-09-17 23:31
    Note a BS2 module can be driven (into Vin) with a 7.5 volt DC supply -- up to a 20 volt DC supply -- it has an on-module linear regulator already. You only need an external regulator if you're driving other circuitry -- which most people do, so that might not help a whole lot, but it SHOULD cut down on the number of linear regulators needed for BS2's.

    Oh, and you need to add one more wire to your DB-9 -- loop pin 6 to pin 7, that's what the IDE uses to detect "cable connected" (aka "Loopback test").
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-17 23:42
    Max and allanlane5--

    Thank you for the guidance . . . I was searching the net looking for more information and had gained vague clues concerning what you put so succinctly.

    I will hit the Digikey site (a new experience for an electronics newbie like me). I had decided to go downstairs and just LOOK at one of my Parallax boards to determine the value of the cap. (Gee. But then I would have to get away from this keyboard!)

    allanlane5, yes, I will want to run other circuitry. And, the RS232 connector should be easy . . . even for me.

    Thanks, again.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-18 00:28
    Max and allanlane5--

    Parallax has the LM2940 for a few cents less than Digikey. I wish I taken the time to search the Parallax site today before I place my (approximate) three hundred dollar order this morning. I would have bought a few.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-19 19:46
    Max and allanlane5 and Stephanie--

    I have achieved a great triumph! Ha! It is of such a trivial nature that only a newbie like me would even mention it.

    Thanks to the three of you and Mike Green on another thread, I have a breadboard with a BS2·OEM and a "bare" BS2 module. One controls the other via a dirt-simple implementation of my bit-signaling scheme. The master does HIGH 0, PAUSE 500, LOW 0, PAUSE 500 and then loops indefinitely. The slave simply watches for a change in state of master pin 0 tied to slave pin 0 via a 1k resistor. When a change in state is detected, it reflects that change in state to slave pin 2, bringing it either HIGH or LOW as the case may be. Of course, slave pin 2 is connected to an LED so I can watch what's going on.

    I have·one question which Max answered in a general way. It is, How many "bare" Stamp MODULES (not the OEM module) may I safely operate off a single BS2 OEM LM2940? All other ciruitry will be powered seperately. I suppose all I need to know is how much current the LM2940 can safely provide (1 amp, continuous?) and how much current a bare BS2 MODULE requires . . . or may not exceed. (I KNOW I've read that somewhere.)

    Thanks!

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-09-19 21:04
    I believe the BS2 'plain' requires the least current of all BS2 variants. Now that you've breadboarded it, you can check it with an ammeter (a multi-meter set to current).

    I think it's around 1 to 2 mA. So, if the 2940 will regulate up to 1 amp before over-heating, you can do 50 of the little tykes.

    Now, each LED takes around 10 mA, so THAT may be your limiting factor.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-19 21:31
    allanlane5--

    Thank you very much!

    By actually READING the Parallax web site, I see the following regarding the BS2 . . .

    Source / Sink Current per unit·······40 mA / 50 mA per 8 I/O pins

    Does this mean that the BS2 can source up to 40 mA per 8 I/O pins and sink 50 mA per 8 I/O pins and no more? In other words, once you have reached 40 mA using 8 output pins, the BS2 will not handle more current drain?

    Of course, all I need to do is understand one example and then I can extend it to the microcontrollers, such as the faster ones, including the BS2p40 with 32 pins, that really interest me.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-19 22:33
    allanlane5--

    Ok. First, I had to figure out how to measure current. (Told you I was a newbie!)

    Then, I set my heapie-cheapie multi-meter on 200 mA (or maybe it was 20 mA; I'm getting old), removed the resistor between the slave Stamp pin and the LED so the only thing that would be running is my tiny program in the slave stamp, and placed the multi-meter in series between VDD of the master Stamp and VDD of the slave Stamp. (In other words, I am powering the slave module off the master's LM2904.) I read varying currents, but basically it was always in the range of 2.6 mA to 3.0 mA with most of the readings closer to 2.6 mA.

    Next, I put the LED back in the circuit and remeasured. With the LED blinking, I saw a current drain as high as about 8 mA.

    Does the above sound anywhere near the mark?

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-09-20 13:13
    Yup, that sounds about right.

    What's happening is that there's two purposes the current you're measuring is serving. The first purpose is keeping the BS2 alive and cycling code. That takes that 3.0 mA you measured with everything disconnected.

    The second purpose is for the BS2 to actually DO something -- like light an LED. As you saw, lighting ONE LED can take 3 times as much current as merely powering the BS2 by itself.

    This is why people have a hard time saying "how much current" a BS2 application will draw -- because it's so heavily dependent on what the BS2 is controlling.

    Now -- BS2 I/O Pins -- the BS2 'plain' is based on the PIC 16C57 microcontroller (with the Parallax proprietary run-time engine burned into it's PROM). The PIC processor was designed to be an interface processor (by MicroChip) so it's I/O pins are quite robust -- source or sink about 20 mA each. However -- the chip itself has a maximum current IT can source or sink. Meaning yes, you CAN run 20 mA through only TWO I/O pins max, before the chip overheats.

    Note that 20 mA is a LOT of current for a small processor. Most applications have the BS2 put out a mA or two to control an external transistor (or LM28003 Darlington Array Chip, designed to handle lots of current) and let the transistor or Darlington handle the power.

    A quick note on "power". "Power" in the IC world translates to "heat" pretty quickly (it IS measured in Watts). The Power equation is: Power == Current * Voltage. So, your linear regulator (for instance) if you drive it at 12 volts, and it's output is at 5 volts, that's a voltage drop of 7 volts. If you pull 3 mA through it, that's .003 Amps * 7 Volts == 0.021 watts. Now, your linear regulator (if it's the TO220 package) can dissapate like 5 watts (as heat -- it gets warm -- and surrounding air cools it). So you're ok.

    If you pull 1 Amp through it, that's 1 Amp * 7 Volts == 7 Watts. Now, if you do that, the linear regulator will heat up so much it will go into "Thermal Shutdown". Solutions? There are several.

    1) Don't pull that much current. Gee thanks, not very helpful, but sometimes you don't NEED that much current, so that's ok.

    2) Put a heat-sink (using conductive grease) on the regulator. If you look up the data-sheet for the linear regulator, there's guidance there. This increases the heat-transfer area from the regulator to the air, so heat can flow faster.

    Now, I told you all that to tell you this -- there's no way to put a heat-sink on a BS2 (or a 16C57, for that matter). So if you DO try to put too much current through it (60 mA through the I/O pins in this case) then it can over-heat destructively. Not to mention the driver circuitry behind individual pins will burn out if you try to run too much current through them.

    And the solution to that is various I/O devices like transistors or darlington arrays or even 74HCT595 chips to off-load the current from the BS2 to some external device that CAN handle currents and heat dissapation like that.

    Bottom line -- it's all good, it can all be worked around, you just have to be aware of the limits and work with them.
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-20 13:38
    allanlane5--

    Thank you for taking the time to write detailed guidance for me.

    I understand. I have been experimenting with the 74HCT595 and its input cousin. I believe that in a real-world application I will be able to use both and not overload THEM!

    I had no real clue about the total current loads I could put on the BS2, however. Your post helped a lot.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2007-09-20 16:45
    Regarding the RS-232 interface....

    It is NOT simple four pins going straight to the BasicStamp.
    3 wires are direct. The RX, The TX, and the GROUND.

    The ATN requires a two 0.1uf capacitors. It would be best to look at a schematic to understand the arangement. One capacitor goes between the DB-9 and the BasicStamp ATN. The other goes from ATN to GND on the BasicStamp side [noparse][[/noparse]not the DB-9 side]

    If you are not programing, you can ignore wiring the ATN line. I created an adapted that includes the capacitors and a Female DB-9. So I just plug the adapter into the 4 left top pins. This eliminates repeating a tedious task.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Everything in the world is purchased by labour; and our passions are the only causes of labor." -- David·Hume (1711-76)········
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Bill ChennaultBill Chennault Posts: 1,198
    edited 2007-09-20 20:08
    Kramer--

    The adapter you created is currently what I am planning to copy. The schematics are dirt simple . . . even for me. That way I can simply plug the adapter in to program the Stamp I want.

    Currently, I cut code, remove the Stamp module from the breadboard, plug it into a PDB or BOE, and run (download) the program. It works, of course . . .

    Thank you for thinking about this for me.

    --Bill

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    You are what you write.
Sign In or Register to comment.