Shop OBEX P1 Docs P2 Docs Learn Events
Using 100 ohm resistors with the Propeller - isn't this bad? — Parallax Forums

Using 100 ohm resistors with the Propeller - isn't this bad?

Julie MarieJulie Marie Posts: 3
edited 2007-05-23 08:29 in Propeller 1
Hi All,

I am a new Propeller user. I was working my way through the labs today. During the second one (Fundamentals: I/O and Timing Basics) I experienced a problem running the program "IncrementOuta.spin". The LEDs would count upward in binary up to about 10 or so and then they would all go dark.

After some basic troubleshooting to ensure that the circuit itself was not at fault - I had run a few dozen other programs on this successfully - I read through the Propeller data sheet. I was VERY surprised to see that the Manual (p. 15, Table 1.1) recommended not to source/sink more than 100ma total across any group of I/O pins at once, nor more than 30 ma per pin.

Well, if you are running a Vdd of 3.3V through 100 ohm resistors, this is 33 ma per I/O pin - and three LEDs lit up at once consume 99 ma. The fourth LED to light up would certainly exceed this limit. This looks strangely similar to the problem that I experienced.

Now, I have two questions:
(1) Is this a known problem that has just not been corrected yet in the labs?
(2) Have I permanently damaged my Propeller chip (and if so, what are the chances of getting another one)?

I am going to use higher value resistors from now on with my SPARE chip that I wisely ordered!

This aside, I love this little chip and its capabilities! Thanks, Parallax - but please help me with this minor issue here. If I have done something wrong, please let me know.

Regards,

Julie

Comments

  • Julie MarieJulie Marie Posts: 3
    edited 2007-05-20 03:25
    I should add that I just checked the voltage on my PE board, and the voltage output of the LM2937 had dropped to 3.11V, and the 9V battery voltage dropped to just over 6V. This was probably the root cause of the program's improper operation. It even failed the same way after I replaced the 100 ohm resistors with 1k ohm resistors on the LEDs and swapping out the Propeller MCU. So, that fixes that issue - I replaced the battery with a new 9V and the program ran properly.

    But I still wonder about the resistor values in the labs. The current output driving the LEDs exceeds the stated ratings. Shouldn't this be fixed?

    Thanks!

    Regards,

    Julie
  • ForrestForrest Posts: 1,341
    edited 2007-05-20 03:28
    A typical LED has a forward voltage drop of 2.0V and consumes 20mA of current. If you do the math or google 'led resistor calculator' you'll find the calculated resistor value is 65 ohms. Rounding up to 100 ohms sounds reasonable and shouldn't damage your Propeller.

    My guess is your battery isn't providing enough voltage to power all the LED's. What battery and/or power supply are you using?
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-05-20 10:41
    Yes you have to remember that the voltage accross the resistor is the voltage out of the pin less the voltage accross the LED which is defined in the LED's specs as the forward voltage. So if you have 3.3v from pin to ground and 2v accross the LED you would have 1.1v accross the resistor and from that you can calculate the resistor value to protect the LED/prop or the current if you already have the resistor.

    Graham
  • Dennis FerronDennis Ferron Posts: 480
    edited 2007-05-21 07:59
    In other words the correct resistor values are smaller than you would expect because the LED "eats" some of the voltage.
  • Julie MarieJulie Marie Posts: 3
    edited 2007-05-23 03:39
    Thanks, guys. I am *so* embarrassed that I neglected to factor in the forward voltage drop on the LEDs. It was late and I was tired... Still, I usually like to underdrive LEDs so I will use a smaller resistor value for prototyping.

    I was using a non-alkaline 9V battery. I have since rethought this, and I will most likely use a plug-in power supply. I recently converted a PC power supply to a bench supply - and since this supplies 3.3V I will probably migrate to using that, plus a much-larger proto-board. This will dramatically simplify things and give me more room for other components and a second Propeller as well.

    I must say that the Propeller sure does make microcontroller programming fun again! I have a Wytek board and as nice as it is, I prefer the Propeller. My first real project with the Propeller will be to interface it to a Maxim MAX1030 ADC and have it serve as an I2C embedded controller. Additionally, I plan to have a whole lot of fun with this cute little chip - the possibilities seem so endless!

    Thanks Again,

    Julie Marie
  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-23 04:44
    If you don't yet have a video display or spare VGA display, I'd suggest you set one up (Parallax's 2.5" LCD video display is cute and works well) for use in debugging. The video output is the easiest since it only needs 3 I/O pins and 3 resistors (on a 4 pin group boundary). Look at the schematic for the Demo Board or the source file for TV.spin for how to do it.
  • Graham StablerGraham Stabler Posts: 2,507
    edited 2007-05-23 08:29
    I'd second Mike's suggestion, a screen is great for debugging, showing off and provides real immediacy to results.

    An alternative to an actual screen or something to use in the mean time is the propterminal program, it can emulate a TV, keyboard and mouse and does it all through the usb programming lead, the only effort is downloading it and changing which files you use for the tv object.

    http://forums.parallax.com/showthread.php?p=649540
Sign In or Register to comment.