Shop OBEX P1 Docs P2 Docs Learn Events
BASIC Stamp 2 Microcontroller Module (BS2-IC rev J) Problem — Parallax Forums

BASIC Stamp 2 Microcontroller Module (BS2-IC rev J) Problem

MooneyguyMooneyguy Posts: 77
edited 2012-01-24 00:17 in BASIC Stamp
I built a circuit using the Basic Stamp Homework Board with about a dozen IC's and related caps, resistors and LED's. I built the same circuit over about 4 times on three different homework boards, all without any real issues other than just the learning aspect. I am now trying to make a more permanent assembly using the subject BS2-IC Module and the Parallax supplied PC Serial Port. The schematic is http://www.parallax.com/Portals/0/Downloads/docs/prod/schem/BS2revJSchematic.pdf My problem is I am having a very difficult time getting it to run.

I have spent many hours checking the board over time after time, and even rebuilt some more complex sections over 3 times. Then I tried to isolate the new things from the assembly. I did this by keeping the same assembly exactly and simply jumpered circuit over to my trusty Basic Stamp Homework board P, Vdd Vss and Vin sockets. After doing that pin for pin (so there were no programming changes), the circuit ran perfect the first time. The connector wiring looks straight forward on the PC Serial port and the connections ring out good with my ohm meter. The stamp connections look pretty straight forward per the referenced schematic.

When I run it with the BASIC Stamp 2 Microcontroller Module (BS2-IC rev J) assembly, LED's are lighting up all over the place brighter than normal, current does not flow in the usual sections, and the debug readings are have a tremendous amount of noise. The LEDs are running too bright and blinking as if they are picking up commands from other parts of the circuit all in parallel. The computer does however, recognize the Stamp and the program runs, but the circuit runs all wrong. I am reading the schematic as if looking down on the module which must be right or the computer would not recognize the stamp when I press the run button. It is almost like there are shorts all over the board microcontroller module. Does anyone have any ideas why this could be happening? Does anyone ever get damaged modules right out of the box?

Comments

  • MooneyguyMooneyguy Posts: 77
    edited 2012-01-16 21:09
    Hi, I just did the post above and learned that I had the stamp board wired wrong some how. After isolating the problem to the Stamp module, I pulled the same jumpers out of my homework board and plugged them very carefully into their respective spots on the breadboard. Guess what? It works!!! Yippee! I am back in the saddle again with a big smile on my face (although the face is a little red from embarrassment at the moment). I don't know how to delete a thread I started so I just added this reply.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-01-16 21:15
    You really really have to generate a schematic from what you have built with the BS2 module. The likelihood that you have a defective module is very small and the likelihood that your problems are due to anything other than the wiring you have or the circuit you're using are also very small. Preferably do not post a schematic of what you believe you have. Use your existing wiring as a model and draw the schematic from that, then post it here.

    The primary difference between the Homework Board and the BS2 module is the 220 Ohm resistors in series with the I/O pins. These are intended to product the I/O pins from accidental short circuits. The module does not have these. If you have any LEDs directly connected to your Homework Board's I/O pins, these resistors will limit the current. With the BS2 module, you have to add series resistors to LEDs and sometimes other components.
  • MooneyguyMooneyguy Posts: 77
    edited 2012-01-16 23:34
    Yep, you were right Mike, it was mis-wiring that caused the problem. It was hard for me to believe that at the time as you can read in the post above. But now I have another question... If I do put LED's in series as sort of an indicator light, and the LED no longer produces light (burns out), does the circuit become open? How long do the LED's last roughly? Is it years of use, thousands of hours, hundreds of hours or tens of hours? At what current level? Just ball park numbers... What would you think would be a good resistor Stamp module that does not already have a 220 ohm resistor built into the board so that it puts out enough light to see outdoors? Would that still be 220 ohms? I also have a push button with a pull down resistor and a photoresistor like the schematic in the What Is A Microcontroller book, are those resistors adequate for the Stamp module I have?
  • bsnutbsnut Posts: 521
    edited 2012-01-17 00:35
    Mike is right on the money about the BS2, it's like Timex watch it licking and keeps on ticking.
    How long do the LED's last roughly? Is it years of use, thousands of hours, hundreds of hours or tens of hours?
    Thousands of hours if you size the series resistor correctly.
    What would you think would be a good resistor Stamp module that does not already have a 220 ohm resistor built into the board so that it puts out enough light to see outdoors? Would that still be 220 ohms?
    The series resistor in a LED circuit based on the LED current of the LED you plan on using, which is based on this formula

    R = (Vsupply - VF)/ILED
    R = series resistor value
    Vsupply = supply voltage
    VF = is the LED forward voltage
    ILED = is the desired LED current

    For a red LED, the series resistor would be (5 - 1.6)/0.01 = 340 ohm

    Don't let the 220 ohm resistor fool you, it's just there to protect the BS2 I/O pins on the Homework board. When you add you the two resistor values together in above example you will get 560 and all this does it lowers the current to the BS2 module.
    I also have a push button with a pull down resistor and a photoresistor like the schematic in the What Is A Microcontroller book, are those resistors adequate for the Stamp module I have?
    Yes
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-01-17 05:38
    You have to be careful when you start looking at high power LEDs (such as the kind that are visible in daylight). There is a limit to how much current a Basic Stamp can supply directly. If the amount of current required by the LED (or anything else you need to control, such as a motor) is more than around 10-20 mA, you probably need to consider using an intermediate switch to supply the power. This could be a relay, a MOSFET, a darlington transistor, or something similar.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-01-17 09:30
    Have a look at the Nuts and Volts Column #6. You can find the Nuts and Volts index using the Resources tab on the main Parallax webpage.
  • MooneyguyMooneyguy Posts: 77
    edited 2012-01-23 20:18
    Bsnut, thanks for the example calculation and explanations, and RLD2004 for the info on daylight LED use. Mike, I did not see in Column #6 (http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol1/col/nv7.pdf) where it explains how to size resistors to provide LEDs best life using the subject board, life of an LED or if an LED goes out does it create an open circuit (or does the light just go out and the circuit continues to perform). Perhaps you intended to state Column #5 http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/vol1/col/nv5.pdf where it discussed sizing the resistors to use with LEDs and temperature effects?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-01-23 20:30
    Actually, I mentioned Column #6 because of its discussion on using external driver transistors to drive loads larger than what the I/O pins can handle directly. See, you look for one thing in Parallax's extensive archives and you fine something else (Column #5) that solves another problem. Ahhh ... the wealth of material ...
  • MooneyguyMooneyguy Posts: 77
    edited 2012-01-24 00:17
    How true it is :-)
Sign In or Register to comment.