Prop source / sink & is it conventional or electron flow?
Bits
Posts: 414
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
Source will put the pin to Vdd (+), Sink will put the pin to Vss (gnd)
An Input is "nothing".
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
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
http://tymkrs.tumblr.com/post/11356800838/propeller-general-i-o-pins-explained
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.
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.
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.
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!
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
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.
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
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
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