Shop OBEX P1 Docs P2 Docs Learn Events
Prop source / sink & is it conventional or electron flow? — Parallax Forums

Prop source / sink & is it conventional or electron flow?

BitsBits Posts: 414
edited 2011-11-23 11:09 in Propeller 1
I want to drive 2 LEDs with the propeller. The manual stated a rating of 30ma sink and 100ms source. But, what is source / sink? I guess I know what it means to source and sink but is the propeller using conventional or electron flow?

Comments

  • RaymanRayman Posts: 14,851
    edited 2011-11-01 12:10
    It's conventional. Electrons flow the other way...
  • tonyp12tonyp12 Posts: 1,951
    edited 2011-11-01 13:36
    It's 30mA sink & source for each pin, total for the chip should not exceed 100mA

    Source will put the pin to Vdd (+), Sink will put the pin to Vss (gnd)
    An Input is "nothing".
  • MagIO2MagIO2 Posts: 2,243
    edited 2011-11-01 14:15
    Don't know where you got these numbers from. The actual version of the datasheet says: 40mA source/sink per pin.
    Furthermore it says that the max. total power consumption is 300mA on Vdd and 300mA on Vss. From the "current consumption of 8 COGs" diagram you can see that max. 100mA are consumed by the COGs. A low amount of currency is consumed by PLL and for driving the crystal, both being low compared to the COG consumption. So, there is round about 200mA left for driving pins.

    Source means that the propeller pin is set to high and drives the LED which is connected to ground via resistor.
    Sink means that the LED is connected to supply voltage via resistor and the propeller pin is low.

    PS: double checked the manual and this also says 40mA source/sink
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-11-01 14:30
    Bits wrote: »
    I want to drive 2 LEDs with the propeller. The manual stated a rating of 30ma sink and 100ms source. But, what is source / sink? I guess I know what it means to source and sink but is the propeller using conventional or electron flow?

    Usually "Source" would be the Propeller providing +3.3v to the LED (w/current limiting resistor) with the other end of the LED connected to ground. For "Sink" one end of the LED (w/current limiting resistor) would be connected to +3.3v and the other end to the Propeller pin which would go low to turn on the LED.

    Do you know the specs on your LED's? Many have a 1.8V voltage drop but others like Blue LED's can be higher. It will help determine what value to use for the current limiting resistor.

    Are you planning on using two separate Propeller pins or two LED's from a single I/O pin?

    Lately I have been using some of the 74HC595 chips wired to "Source" the power for a bank of 8 LED's per chip. I use bright LED's so I can limit the current to 6mA per LED to fit within the specs of the chip yet still have the same level of brightness for a regular LED.

    Robert
  • tonyp12tonyp12 Posts: 1,951
    edited 2011-11-01 15:00
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-11-01 15:30
    I guess I know what it means to source and sink but is the propeller using conventional or electron flow?

    Everything in electronics is "conventional" flow. ie imaginary positive things that flow from positive to negative. I think the reason is that electronic circuits were invented before electrons were discovered, and the convention has stuck because it is too hard to change. A bit like the QWERTY typewriter, which was designed deliberately to be the slowest typewriter layout so the keys wouldn't jam.

    For driving leds, use a series resistor - anything from 220R to 2k will work and if it is not bright enough, use a lower resistor (I have some superbright ones that are still too bright even with 3k resistors). Then if you have a series resistor, nothing bad happens even if you put the led in the wrong way.
  • BitsBits Posts: 414
    edited 2011-11-01 16:20
    Yes I think I understand now I was just not sure if some manufactures use conventional or electron flow. I just had to ask.
    A bit like the QWERTY typewriter, which was designed deliberately to be the slowest typewriter layout so the keys wouldn't jam.
    This is the kind of stuff that comes in handy on those long road trips. I like!

    Oh by the way I am going to use a 1K Ohm resistor.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-11-01 16:22
    I use 1k resistors too - they seem to give about the right amount of brightness. Have you got a propeller flashing leds yet?
  • BitsBits Posts: 414
    edited 2011-11-01 16:28
    Oh heavens yes!

    Lets see. My propeller is currently connected to 2 LEDs, 20 bit ADC, 16 bit DAC, 4x20LCD through an IO extender, FTDI IC, MAX 232 IC, Digital 256 bit potentiometer, and a few Pchan mosfets / Nchan mosfets.

    I find this chip to be wonderful. The only downside is there is not enough i/o pins.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-11-01 17:11
    My propeller is currently connected to 2 LEDs, 20 bit ADC, 16 bit DAC, 4x20LCD through an IO extender, FTDI IC, MAX 232 IC, Digital 256 bit potentiometer, and a few Pchan mosfets / Nchan mosfets.

    Wow. What is next, World Domination?!

    I agree there are not enough pins. But there seem to be lots of solutions, including latches (HC374), I/O extenders on SPI and I/O extenders on I2C. I'm still learning about all these too. It is great fun!
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2011-11-01 17:27
    Bits wrote: »
    Oh heavens yes!

    Lets see. My propeller is currently connected to 2 LEDs, 20 bit ADC, 16 bit DAC, 4x20LCD through an IO extender, FTDI IC, MAX 232 IC, Digital 256 bit potentiometer, and a few Pchan mosfets / Nchan mosfets.

    I find this chip to be wonderful. The only downside is there is not enough i/o pins.

    Sounds like you are off to a great start with the Propeler.

    To expand the I/O checkout the 74HC165 (inputs) and the 74HC595 (outputs). There is a great 595 object for the propeller that easily handles four of the 595's for 32 outputs. It even lets you set PWM for each pin and updates them in the background. I'm using that to control a bunch of LED's on a robot.

    Robert
  • BitsBits Posts: 414
    edited 2011-11-01 17:35
    World Domination would be a tall order for a girl even with the propeller at her side. :smile:

    You mention the HC374 and from what I gather its 8 flip flops, when would one of these be implemented in-conjunction with a propeller (assuming that is what you use it with). I have used them in clock circuits, and as latches but never with a micro-processor. Hum.

    If you would like help using any of the ICs I mentioned above just ask away and Ill do my best.
  • JonnyMacJonnyMac Posts: 9,198
    edited 2011-11-01 17:59
    I'm working on a big commercial device with lots of IO, too. We ended up using two MCP23017s for low-speed IO and for chip select lines for several devices that share the SPI buss. We also have an LCD running in 4-bit mode and are sharing the data buss with buttons to create a nice little HMI for the device.
  • TymkrsTymkrs Posts: 539
    edited 2011-11-22 22:54
    tonyp12 wrote: »

    Actually, I didn't realize until we recorded First Spin that I was taking those 30mA values off of the Parallax Manual v1.0 - I have since been corrected and will do the same for the tumblr post - thanks for reminding me!

    @atdiy/@tymkrs
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2011-11-23 09:59
    One can prove even the electronics guys don't believe in electrons :lol:

    They think "Conventional" with "Positive" current flow.
    Look at electronic symbols with "Arrows" in them. Such as diodes and transistors.
    Positives flow in the direction of the arrows and don't flow against the arrows.

    Just saying!!!
    Duane
  • Roy ElthamRoy Eltham Posts: 3,000
    edited 2011-11-23 10:59
    MagIO2 wrote: »
    Don't know where you got these numbers from. The actual version of the datasheet says: 40mA source/sink per pin.
    Furthermore it says that the max. total power consumption is 300mA on Vdd and 300mA on Vss. From the "current consumption of 8 COGs" diagram you can see that max. 100mA are consumed by the COGs. A low amount of currency is consumed by PLL and for driving the crystal, both being low compared to the COG consumption. So, there is round about 200mA left for driving pins.

    Source means that the propeller pin is set to high and drives the LED which is connected to ground via resistor.
    Sink means that the LED is connected to supply voltage via resistor and the propeller pin is low.

    PS: double checked the manual and this also says 40mA source/sink

    Version 1.0 of the manual said 30mA per pin with 100mA total, the most recent version says 40mA per pin with 300mA for the whole chip.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-11-23 11:09
    First-run specs should always be made with an abundance of caution, and Parallax appears to have done the right thing in this regard. After more extensive testing and experience, specs can be loosened as appropriate. It's important to stress, though, that those are Absolute Maximum Ratings, above which damage can occur to the chip. They are not values that are recommended for normal operation.

    -Phil
  • jazzedjazzed Posts: 11,803
    edited 2011-11-23 11:09
    Sink holes can be the source of much confusion.
Sign In or Register to comment.