A
Allen Bong
- Jan 1, 1970
- 0
Hi Group,
The schematic below (in ASCII art, please view with Fixed font) shows
how my friend connects a switch and an LED to one port, so he can make
use the port to read a switch in input mode and then changes the port
direction to light up the LED.
My questions are:
1. Would this design cause the port to overload and eventually get
destroyed if the switch is pressed too long?
2. Isn't it advisible to have a diode or resistor added between the
switch and the port to prevent the above from happening?
3. If 26 LEDs each consuming 15mA, were connected to the PIC, and all
were switched ON during startup test for a few seconds. Would this
endanger the PIC (say 16F877 as an example)?
4. I have seen in schematic examples that 10 LEDs were connected to a
4017 without any current limiting resistor. Does the CMOS output has
some special properties to limit its output current?
5. The PIC datasheet says that each port can source or sink 25mA. Is
this the Max current or working current?
Thank you for reading. Any feedback is welcomed.
Merry Christmas and regards.
Allen Bong
VCC
|
|---o---|
.-----------------------. | | |
| | \ o\ o\ o
| PIC | \ \ \
| | \. \. \.
'-----|------|-----|----' sw1o o o
| | | |sw2|sw3|
o------|-----|---------o | |
| o-----|---------|---o |
| | o---------|---|---o
| | | | | |
V -> V -> V -> | | |
-LED1 -LED2 -LED3 | | |
| | | | | |
| | | | | |
.-. .-. .-. .-. .-. .-.
| | | | | | | | | | | |
220| | 220| |220| | | | | | | |
'-' '-' '-' '-' '-' '-'
| | | 10k|10k|10k|
| | | | | |
o------o-----o---------o---o---|
|
|
GND
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)
The schematic below (in ASCII art, please view with Fixed font) shows
how my friend connects a switch and an LED to one port, so he can make
use the port to read a switch in input mode and then changes the port
direction to light up the LED.
My questions are:
1. Would this design cause the port to overload and eventually get
destroyed if the switch is pressed too long?
2. Isn't it advisible to have a diode or resistor added between the
switch and the port to prevent the above from happening?
3. If 26 LEDs each consuming 15mA, were connected to the PIC, and all
were switched ON during startup test for a few seconds. Would this
endanger the PIC (say 16F877 as an example)?
4. I have seen in schematic examples that 10 LEDs were connected to a
4017 without any current limiting resistor. Does the CMOS output has
some special properties to limit its output current?
5. The PIC datasheet says that each port can source or sink 25mA. Is
this the Max current or working current?
Thank you for reading. Any feedback is welcomed.
Merry Christmas and regards.
Allen Bong
VCC
|
|---o---|
.-----------------------. | | |
| | \ o\ o\ o
| PIC | \ \ \
| | \. \. \.
'-----|------|-----|----' sw1o o o
| | | |sw2|sw3|
o------|-----|---------o | |
| o-----|---------|---o |
| | o---------|---|---o
| | | | | |
V -> V -> V -> | | |
-LED1 -LED2 -LED3 | | |
| | | | | |
| | | | | |
.-. .-. .-. .-. .-. .-.
| | | | | | | | | | | |
220| | 220| |220| | | | | | | |
'-' '-' '-' '-' '-' '-'
| | | 10k|10k|10k|
| | | | | |
o------o-----o---------o---o---|
|
|
GND
(created by AACircuit v1.28.6 beta 04/19/05 www.tech-chat.de)