PDA

View Full Version : Prop source / sink & is it conventional or electron flow?



Bits
11-01-2011, 07:00 PM
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?

Rayman
11-01-2011, 07:10 PM
It's conventional. Electrons flow the other way...

tonyp12
11-01-2011, 08:36 PM
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".

MagIO2
11-01-2011, 09:15 PM
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

RobotWorkshop
11-01-2011, 09:30 PM
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

tonyp12
11-01-2011, 10:00 PM
I used this data, maybe old.
http://tymkrs.tumblr.com/post/11356800838/propeller-general-i-o-pins-explained

Dr_Acula
11-01-2011, 10:30 PM
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.

Bits
11-01-2011, 11:20 PM
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_Acula
11-01-2011, 11:22 PM
I use 1k resistors too - they seem to give about the right amount of brightness. Have you got a propeller flashing leds yet?

Bits
11-01-2011, 11:28 PM
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_Acula
11-02-2011, 12:11 AM
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!

RobotWorkshop
11-02-2011, 12:27 AM
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

Bits
11-02-2011, 12:35 AM
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.

JonnyMac
11-02-2011, 12:59 AM
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.

Tymkrs
11-23-2011, 05:54 AM
I used this data, maybe old.
http://tymkrs.tumblr.com/post/11356800838/propeller-general-i-o-pins-explained

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. Johnson
11-23-2011, 04:59 PM
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 Eltham
11-23-2011, 05:59 PM
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)
11-23-2011, 06:09 PM
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

jazzed
11-23-2011, 06:09 PM
Sink holes can be the source of much confusion.