This is just an example..
Lets say that I want the PIC to flash a LED on and off when the negative pin is connected to the PICs output pin. Can I do this without using a transistor?
So, what I'm asking for is if it's possible to completely disable a pin from both positive and negative currency programatically to make this connection flash.
hi!
I think you are actually trying to put a diode after the PIC output.
PIC just gives two logic levels 1 and 0; which are generally 5V volts and 0V. so if you see it theoratically then you have to apply a potential higher than 5V on the other pin(+ve) of the LED which will drive it. But this have to appear only when PIC gives logic 1 otherwise the LED will keep on glowing.
This can be possible by using the OP-Amp comparator config. or in other case you have to use transistor to drive LED.
Programaticaly you can just get 0 or 1;
So, the basic version of this is to basically just add a diode between the PIC pin and LED pin and send a positive 1 out from PIC when I want the LED to be off and a 0 when I want it to be on?
So, the basic version of this is to basically just add a diode between the PIC pin and LED pin and send a positive 1 out from PIC when I want the LED to be off and a 0 when I want it to be on?
If you use a diode in between PIC and LED then no operation will be performed.
Use led direct with PIC pin,but be sure the voltage you are applying to the led not exceed 5v,
There is two way to turn ON & OFF the LED.
1. By using External current limiting resitor in series with LED & connect to microcontrollerwhich will give high & low signal to LED for turn ON & OFF.
2. Directly connect LED to microcontroller & give PWM pulse to turn ON the LED just make sure that Duty cycle is not more.For turn off give low signal (0v) to LED.
But how is this going to make the LED flash?
Please don't laugh now.. If I connect the LED to +9V to a 330Ω resistor followed by a LED. The LED voltage is 3 volt and 20 mA This must mean that the PIC pin will have something near +3V which is lower than/and will not exeed +5V. Maybe that I'm wrong, because my electric skill are not soo good.. I'm a programmer trying to learn this part too.
There is two way to turn ON & OFF the LED.
2. Directly connect LED to microcontroller & give PWM pulse to turn ON the LED just make sure that Duty cycle is not more.For turn off give low signal (0v) to LED.
Chanchal.
This is breaking my head.. I can't see how this will be done with PWN pulse? To turn it off by giving it 0V? Didn't you mean near to 0V but still over zero. Otherwise.. wouldn't the pin on the PIC be GND for the LED and turn it on again?
I had never done anything with PWN pulses yet in my life, only read about it.
Now when the pin is high (+5V), there will be no voltage through the LED and resistor. When the pin is low, the 100Ω resistor will limit the current and the LED will light.
Now when the pin is high (+5V), there will be no voltage through the LED and resistor. When the pin is low, the 100Ω resistor will limit the current and the LED will light.
But I have one more question when it comes to the VDD pin on the PIC that should have +5V and maximum current of 250 mA. Is it possible to connect +9V to this pin without burning the darn thing, by adding a resistor to bring down the currency with this calculation: (+9V-+5V) / 0,250A = R = atleast 16Ω Is this workable or will it still break the PIC?