also,
I dont usually use that and/or have seen this, but should we put resistors to ALL output pins of the microcontroller?
also,
I dont usually use that and/or have seen this, but should we put resistors to ALL output pins of the microcontroller?
Last edited by lerameur; - 26th January 2007 at 12:27.
When I used the word pin, I meant the literal piece of metal sticking out of the part. I guess I should have said leads.
The opto coupler is made from 2 LEDs, 2 photo transistors. So in a word, Yes all the opto couplers LEDs should have series resistors.
As far as your PIC goes, I (personally) never leave pins floating out in space, I always tie them to Power or Ground as appropriate to their respective conditions.
I hope you found this to be of value.
JS
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
so you are saying that you do put a resistor between the pin and anything that is connecet right, like an h-bridge or another microcontroller right
The pic outputs are matched to TTL levels, you can connect them directly to 5 volt logic devices without resistors.
A resistor is used anytime you need to limit the current to keep from smoking your PIC. look at the data sheet and see what the output ports can source or sink. What is the load you are putting on it? A 16f628A can sink or source 25 ma on each I/O pin and keep in the magic smoke. a resistor may be required in series to keep the current below the magic 25ma. In the case of these opto couplers a resistor is definately needed.
So looking at the DATA sheet from the opto coupler, the diode operates on 1.25 volts at 20ma. If you are using a 5 volt supply then the formula is :
5v - 1.25 v / .02 = 187.5 ohm so round up the closest say 200 ohm resistor and you are golden.
Last edited by Archangel; - 28th January 2007 at 09:43. Reason: Add
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Ok I am continuing my project.
I get a compiling error for my If then loop:
If I hide the two last line , then I dont get any error. But I need those lines. Any ideas?
if portb.0 = 1 then goto Option1
if portb.1 = 1 then goto Option2
if portb.2 = 1 then goto Option3
if portb.3 = 1 then goto stopping
else goto stopping
endif
error:
C:\PBP\MOTORG.BAS ERROR Line 62: Syntax error.
C:\PBP\MOTORG.BAS ERROR Line 63: ENDIF without a matching IF..THEN.
C:\PBP>
HI,
hope you are doing good.
I read a thread on this site concerning the 7805 overheating.
My 7805 is overheating even with a heat sink and I just have a LCD a pic chip and a RF receiving module. I tried the tricks they say but none is working.
I tried conencting the backlight directly to the 12v battery using a 150 IOhm resistor, or t o the 5V output of the 7805 with a 22 ohm resistor. Whils always keeping the LCD Vdd to the 5v of the 7805.
It heats op in every case ?
any ideas ?
Lcd 16 x2: UNIQ/eVision GC-1602I1
Last edited by lerameur; - 2nd February 2007 at 01:04.
Bookmarks