Shop OBEX P1 Docs P2 Docs Learn Events
PEKit: Cannot make RCDecay to work — Parallax Forums

PEKit: Cannot make RCDecay to work

DimitriDimitri Posts: 7
edited 2012-05-04 08:50 in Propeller 1
So far, Propeller Edution Kit was fun and easy. Currently I am stuck with RCDelay example:

The lab expects the following schematics:
Schematics.PNG

My circuit is as following:
Circuit.jpg


I use 103 capacitor which should be 0.01 μF.

The spin code is from lab "TestRcDecay.spin" (unchanged) (I attach it here as well)
[ATTACH]92215[/ATTACH]

When I run the program it returns me constant 'time = 0". Turning potentiometer knob does not help...
Serial Terminal Output.PNG


Any ideas are appreciated.

Thank you,
Dimitri
507 x 163 - 11K
1024 x 765 - 87K
655 x 295 - 27K

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2012-05-04 02:22
    Figure 3-3 of the PE-Kit tells me that each group of 6 sockets is electrically connected. This would suggest that your capacitor isn't doing anything useful and you effectively wired pin 17 to ground which is not a good idea.
  • StefanL38StefanL38 Posts: 2,292
    edited 2012-05-04 05:52
    Hi Dimitri,

    I highly recommend to insert a 150 Ohm resistors between each propeller-IO-pin and the thing you want to connect.

    I mean this way

    Prop-IO-Pin-No 0
    150-Ohm
    anything you former connected to the IO-Pin
    Prop-IO-Pin-No 1
    150-Ohm
    anything you former connected to the IO-Pin
    Prop-IO-Pin-No 2
    150-Ohm
    anything you former connected to the IO-Pin
    ....
    Prop-IO-Pin-No 31
    150-Ohm
    anything you former connected to the IO-Pin

    Why this?

    This will protect the prop-IO-pin from sourcing or sinking too much current if you accidently connect them to either +3.3V or 0V.
    This short peace of wire has a resistance of 0,1 Ohm.
    Now imagine you have programmed the IO-pin as output and set him to +3.3V and connect it through 0,1 Ohm to ground.
    current 3.3V / 0.1 Ohm = 33A (theoretically). As the current rises something inside the propeller-chip will burn through.
    You are a lucky guy if this hasn't happened. Now with 150 Ohm inbetween

    3.3V / 150 Ohm = 22mA. Which is a save value. (Each IO-pin can drive 30 mA).
    Additionally I recommend examining carefully how each whole on your breadboard is connected to the others.
    Reading basic materials about electronics is a good idea too.
    This is a website that explains the things in a quite good to understanding way. (which is seldom on the internet)
    http://openbookproject.net//electricCircuits/DC/index.html
    best regards

    Stefan
  • DimitriDimitri Posts: 7
    edited 2012-05-04 08:50
    kuroneko wrote: »
    Figure 3-3 of the PE-Kit tells me that each group of 6 sockets is electrically connected. This would suggest that your capacitor isn't doing anything useful and you effectively wired pin 17 to ground which is not a good idea.

    Thank you, kuroneko! You were exactly right it was not doing anything. Once I changed layout, RCDecay started working just fine:
    Circuit Fixed.jpg


    Re: Stefan's suggestion:
    StefanL38 wrote: »
    I highly recommend to insert a 150 Ohm resistors between each propeller-IO-pin and the thing you want to connect.

    I agree with your suggestion as a rule of thumb. However, PEKit documentation explicitely addressed this approach for potentiometer exercise. Here is a quote from page 127:
    A 100 Ω series resistor can instead be placed between the I/O pin and the RC circuit. The main benefit
    of this approach is that it reduces any potential effects of even a brief current inrush when the I/O pin starts
    charging the capacitor. The main drawback is that a protection resistor at the I/O pin forms a voltage divider
    with the potentiometer’s resistance
    , which in turn prevents the capacitor from charging to 3.3 V. Instead, the
    capacitor charges to 3.3 V × R ÷ (R + 100). As the value of R gets smaller, the voltage the capacitor can
    charge to before the decay measurement starts also drops. Although Δt would still vary with R over most of
    the potentiometer’s range of motion, the measured decay time would no longer be directly proportional to
    resistance
    ...

    I guess I was just like that I didn't burn my Propeller chip.

    Thank you for your suggestion.

    dimitri
    1024 x 765 - 91K
Sign In or Register to comment.