74LS04 Chip
Moderator: Moderators
74LS04 Chip
OK,
So we have.
74LS04 Chip. I downloaded the data sheet.
So
Vcc pin 14 that would be +5V from I/O port.
GND pin 7 that would be GND from I/O port.
Logic Gate pin 1 would be PB0
So once PB0 goes through logic gate I get +5V buffered?
Am I correct?
So we have.
74LS04 Chip. I downloaded the data sheet.
So
Vcc pin 14 that would be +5V from I/O port.
GND pin 7 that would be GND from I/O port.
Logic Gate pin 1 would be PB0
So once PB0 goes through logic gate I get +5V buffered?
Am I correct?
- Mike
- Herr VC
- Posts: 5134
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Hi Devlin,
you'll get the inverted value of PB0 at pin 2. I downloaded this data sheet. For your question the most interesting values are:
I_OH High-level output current -0,4 mA
I_OL Low-level output current 8 mA
I.e., this circuit is just able to drive another single TTL input. At least you'll protect PB0 from shorts, etc. But you can't do much more.
What you need is a driver circuit that accepts TTL input. I found the TC4424 here. Maybe that is more like what you want. Note: the schematic shown there requires an external power supply. The VIC power supply is far too weak to drive motors, etc.
Greetings,
Michael
you'll get the inverted value of PB0 at pin 2. I downloaded this data sheet. For your question the most interesting values are:
I_OH High-level output current -0,4 mA
I_OL Low-level output current 8 mA
I.e., this circuit is just able to drive another single TTL input. At least you'll protect PB0 from shorts, etc. But you can't do much more.
What you need is a driver circuit that accepts TTL input. I found the TC4424 here. Maybe that is more like what you want. Note: the schematic shown there requires an external power supply. The VIC power supply is far too weak to drive motors, etc.
Greetings,
Michael
74LS04
First off this was not about motors. Sorry Mike.
The Idea was about the 74LS04 Chip being powered by +5VDC on I/O port.
The fact that the I/O port has +5VDC.
And how +5VDC can be switched on and off with PB0-PB5.
Using a buffer so when PB0-PB5 are switched on/off the I/O does not short out.
I just wanted to know if I was using the correct connections to the chip.
So if it does work then you can have 6 gates hooked up.
PB0-PB5 = 6 Hookups to gates.
This makes full use of the chip.
I was recommened to use this chip.
And wanted to know if all my views on the chip where correct.
THE HOOKUP!
If anyone else has used or know about the 74LS04 Please Post.
Another soultion here is with the +5VDC that comes out of the I/O port can power the chip and there is no need for extra power supply on the chip.
The Idea was about the 74LS04 Chip being powered by +5VDC on I/O port.
The fact that the I/O port has +5VDC.
And how +5VDC can be switched on and off with PB0-PB5.
Using a buffer so when PB0-PB5 are switched on/off the I/O does not short out.
I just wanted to know if I was using the correct connections to the chip.
So if it does work then you can have 6 gates hooked up.
PB0-PB5 = 6 Hookups to gates.
This makes full use of the chip.
I was recommened to use this chip.
And wanted to know if all my views on the chip where correct.
THE HOOKUP!
If anyone else has used or know about the 74LS04 Please Post.
Another soultion here is with the +5VDC that comes out of the I/O port can power the chip and there is no need for extra power supply on the chip.
- eslapion
- ultimate expander
- Posts: 5037
- Joined: Fri Jun 23, 2006 7:50 pm
- Location: Canada
- Occupation: 8bit addict
I understand a bit more about what you want to do now.
The 74LS04 is an HEX inverter so technically it should do what you want BUT it is a TTL chip which means even if it will accept 0/5V as input, its output should only be 0/3.5V. (LS stands for Low power Schottky) It is worth noting that considering the application, using a 74LS14 will give exactly the same result.
TTL chips, even when fed with 5V (and that is really what they should be connected to, to power them up) output a logical one at about 3.5V as they have an internal voltage drop equivalent to 2 diodes in series.
CMOS chips, however, have their output tied to the same level as what they are powered with.
In other words, as a real inverter buffer, you should consider using a 74HC04 or 74HCT04 or 74HC14 or 74HCT14. Considering your application all these chips will do exactly the same thing for you. (where HC stands for High speed CMOS)
Now, all these chips, just as the 74LS04 are INVERTER chips which means if the output from PBX (where X can range from 0 to 7) is 0V then the output from the 74... chip section connected to that line will be 3.5V or 5V and vice versa. Or, said differently, a 0 becomes 1 and 1 becomes 0.
The inversion is an advantage if you want to boost the umpff. As pointed out by Mike, logic chip themselves are not designed to drive LEDs or other things directly. Boosting can be easily accomplished using a simple 2N2222 or 2N3904 transistor. In this case, having a one represented as 3.5V or 5V makes virtually no difference.
Take a look at the section "Connecting a transistor to the output from a chip" in this page : http://www.kpsec.freeuk.com/trancirc.htm
Incidentally, this configuration is also an inverting one so connecting this to the output of your 74... chip will "undo" the first inversion.
Forget all the complicated calculations, just look at the plan and consider Rb to be 1k Ohm. Rl is what you want to power up. For example, if what you wanted to turn on is an LED and this LED requires a 330 ohms resistor in series to work fine at 5V then Rl consists of an LED in series with a 330 Ohms resistor.
This configuration can easily drive up to 150mA. For higher powered application, you can replace the 2n2222 or 2n3904 with a power MOSFET but that will certainly require an external source of power if you don't want to destroy your VIC/C64 power supply.
Your LED will turn ON when PBX attached to its driver inverter (the 74... chip) is set to one and OFF when it is set to zero...
If you want to drive all eight PB lines from the user port with a single chip, you could use a 74LS373, an octal transparent latch. This chip will not invert its input as an 74XX04 or 74XX14 would but it will isolate the transistor from the fragile PB lines and it can drive a transistor through a 1 kOhm resistor just as well. However, a one becomes an OFF signal and a zero becomes an ON signal, assuming you still use a transistor as shown above to boost the current.
With a 74LS373 or 74HC373, you must connect pin 1 to 0V or ground and pin 11 to 5V in order for it to act as a non-inverting buffer.
Hope this helps you out.
The 74LS04 is an HEX inverter so technically it should do what you want BUT it is a TTL chip which means even if it will accept 0/5V as input, its output should only be 0/3.5V. (LS stands for Low power Schottky) It is worth noting that considering the application, using a 74LS14 will give exactly the same result.
TTL chips, even when fed with 5V (and that is really what they should be connected to, to power them up) output a logical one at about 3.5V as they have an internal voltage drop equivalent to 2 diodes in series.
CMOS chips, however, have their output tied to the same level as what they are powered with.
In other words, as a real inverter buffer, you should consider using a 74HC04 or 74HCT04 or 74HC14 or 74HCT14. Considering your application all these chips will do exactly the same thing for you. (where HC stands for High speed CMOS)
Now, all these chips, just as the 74LS04 are INVERTER chips which means if the output from PBX (where X can range from 0 to 7) is 0V then the output from the 74... chip section connected to that line will be 3.5V or 5V and vice versa. Or, said differently, a 0 becomes 1 and 1 becomes 0.
The inversion is an advantage if you want to boost the umpff. As pointed out by Mike, logic chip themselves are not designed to drive LEDs or other things directly. Boosting can be easily accomplished using a simple 2N2222 or 2N3904 transistor. In this case, having a one represented as 3.5V or 5V makes virtually no difference.
Take a look at the section "Connecting a transistor to the output from a chip" in this page : http://www.kpsec.freeuk.com/trancirc.htm
Incidentally, this configuration is also an inverting one so connecting this to the output of your 74... chip will "undo" the first inversion.
Forget all the complicated calculations, just look at the plan and consider Rb to be 1k Ohm. Rl is what you want to power up. For example, if what you wanted to turn on is an LED and this LED requires a 330 ohms resistor in series to work fine at 5V then Rl consists of an LED in series with a 330 Ohms resistor.
This configuration can easily drive up to 150mA. For higher powered application, you can replace the 2n2222 or 2n3904 with a power MOSFET but that will certainly require an external source of power if you don't want to destroy your VIC/C64 power supply.
Your LED will turn ON when PBX attached to its driver inverter (the 74... chip) is set to one and OFF when it is set to zero...
If you want to drive all eight PB lines from the user port with a single chip, you could use a 74LS373, an octal transparent latch. This chip will not invert its input as an 74XX04 or 74XX14 would but it will isolate the transistor from the fragile PB lines and it can drive a transistor through a 1 kOhm resistor just as well. However, a one becomes an OFF signal and a zero becomes an ON signal, assuming you still use a transistor as shown above to boost the current.
With a 74LS373 or 74HC373, you must connect pin 1 to 0V or ground and pin 11 to 5V in order for it to act as a non-inverting buffer.
Hope this helps you out.
74LS373 Chip
Ok so 74LS373 using +3V Relays on all eight.
Will this work so I do not have to boost up to +5V.
Also is it possible to have 4 outputs to +3V Relays.
And 4 inputs with +3V Relays? Total 4 outputs and 4 inputs = 8 connections. Using +5V from user port to power Chip?
Or can I only Have 8 +3.5V outputs ?
Thus no need to boost up to +5V per PB0-PB8.
If need be relays for inputs can have diffrent power supply?
Or I can go with 8 outputs to run 8 +3V relays.
TaDA Switching Device.
Will this work so I do not have to boost up to +5V.
Also is it possible to have 4 outputs to +3V Relays.
And 4 inputs with +3V Relays? Total 4 outputs and 4 inputs = 8 connections. Using +5V from user port to power Chip?
Or can I only Have 8 +3.5V outputs ?
Thus no need to boost up to +5V per PB0-PB8.
If need be relays for inputs can have diffrent power supply?
Or I can go with 8 outputs to run 8 +3V relays.
TaDA Switching Device.
- eslapion
- ultimate expander
- Posts: 5037
- Joined: Fri Jun 23, 2006 7:50 pm
- Location: Canada
- Occupation: 8bit addict
If you use transistors to boost the current output capacity on all 8 lines of the 74LS373, then there is no need to use 3V relays.
If you follow the plan given at the web page I mentioned, +Vs can be any external voltage source that will not fry up the 2N3904 transistor. It can be up to 40 volts. I suggest using a 12V source whose ground is mated with the VIC-20's then you can use the more common types of relays.
You must also consider that a relay's coil is an inductive load and will probably destroy the transistor when it is turned off unless you put in there an antiparallel freewheeling diode. See the second picture in the section "Using a transistor as a switch" subsection "Protection diode". There is also a nice explanation there as to why it is needed. I recommend you use a diode of type 1N5819.
A simple question here; why relays? What exactly is it you want to control with these things ?
If you follow the plan given at the web page I mentioned, +Vs can be any external voltage source that will not fry up the 2N3904 transistor. It can be up to 40 volts. I suggest using a 12V source whose ground is mated with the VIC-20's then you can use the more common types of relays.
You must also consider that a relay's coil is an inductive load and will probably destroy the transistor when it is turned off unless you put in there an antiparallel freewheeling diode. See the second picture in the section "Using a transistor as a switch" subsection "Protection diode". There is also a nice explanation there as to why it is needed. I recommend you use a diode of type 1N5819.
A simple question here; why relays? What exactly is it you want to control with these things ?
4 Channel Remote Control
I have a 8 channel remote control system that has 8 switches that can be used.
So it is going to be a remote controled Robot.
I wanted the vic to control the robot.
So I figured I could replace the push switches with relays.
But I am thinking. Instead of relays can I use transistors as electronic switches.
So it is going to be a remote controled Robot.
I wanted the vic to control the robot.
So I figured I could replace the push switches with relays.
But I am thinking. Instead of relays can I use transistors as electronic switches.
- eslapion
- ultimate expander
- Posts: 5037
- Joined: Fri Jun 23, 2006 7:50 pm
- Location: Canada
- Occupation: 8bit addict
Re: 4 Channel Remote Control
Most of the time, yes. However, to be sure you're going to get the desired result and make sure you're not just going to fry your remote control this requires a careful investigation of the schematics of the remote control.Devlin wrote:Instead of relays can I use transistors as electronic switches.
Re Design of circuit.
Ok I changed a few things.
First off I will use 74LS373. I know now how to hook up to I/O.
Then when PB0 Is switched on I get +3V. Or PB1,PB2 ect ect.
Then a PNP Trnasistor hooked to PB0. The +3V goes to Base of Transistor.
Also +9V goes to Collector Of PNP Transistor. As With a +9V power supply DC of course.
-9V hooked to ground on I/O port.
With this,PNP Transistor switches 9Volts on and off.
Questions. With the +9V connection to transistor will I need a resistor so I do not fry the transistor. Same with +3V off chip.
If so what resistors do I need for the +9V and +3V hooked to transistor.
Also what type of transistor should I use.
This is my idea on this.
And yes a diode on the +9V hooked to relay so no static. What diode?
Should work.
Thanks.
First off I will use 74LS373. I know now how to hook up to I/O.
Then when PB0 Is switched on I get +3V. Or PB1,PB2 ect ect.
Then a PNP Trnasistor hooked to PB0. The +3V goes to Base of Transistor.
Also +9V goes to Collector Of PNP Transistor. As With a +9V power supply DC of course.
-9V hooked to ground on I/O port.
With this,PNP Transistor switches 9Volts on and off.
Questions. With the +9V connection to transistor will I need a resistor so I do not fry the transistor. Same with +3V off chip.
If so what resistors do I need for the +9V and +3V hooked to transistor.
Also what type of transistor should I use.
This is my idea on this.
And yes a diode on the +9V hooked to relay so no static. What diode?
Should work.
Thanks.
- eslapion
- ultimate expander
- Posts: 5037
- Joined: Fri Jun 23, 2006 7:50 pm
- Location: Canada
- Occupation: 8bit addict
Im sorry to have to say that but the configuration you suggest doesn't seem to be good at all.
You suggest connecting the collector of a PNP transistor to +9V while the collector on a PNP is made to OUTPUT current, not take it in.
Assuming you do the opposite, that is connect the EMITTER to the +9, which is the normal thing to do and then connecth the base to the output of the 74(whatever) then because the base is more than 0.7V lower than the emitter voltage then the transistor, as a switch, is always on no matter what comes out of the chip... NOT good...
When using transistors as switches, you can either use an NPN to pull down to the ground and it is switched on when current flow INTO the base or a PNP to pull up to a certain voltage and this is switched on when current flows OUT OF the base.
Current flows out of (or into) the base of a transistor when the voltage difference between the base and the emitter reaches about 0.7V. In the case of an NPN, the base must have a higher voltage than the emitter and in the case of an PNP, the base voltage must be lower than that of the emitter.
Also, for common applications designers try to avoid PNPs because they are much slower than NPNs.
You suggest connecting the collector of a PNP transistor to +9V while the collector on a PNP is made to OUTPUT current, not take it in.
Assuming you do the opposite, that is connect the EMITTER to the +9, which is the normal thing to do and then connecth the base to the output of the 74(whatever) then because the base is more than 0.7V lower than the emitter voltage then the transistor, as a switch, is always on no matter what comes out of the chip... NOT good...
When using transistors as switches, you can either use an NPN to pull down to the ground and it is switched on when current flow INTO the base or a PNP to pull up to a certain voltage and this is switched on when current flows OUT OF the base.
Current flows out of (or into) the base of a transistor when the voltage difference between the base and the emitter reaches about 0.7V. In the case of an NPN, the base must have a higher voltage than the emitter and in the case of an PNP, the base voltage must be lower than that of the emitter.
Also, for common applications designers try to avoid PNPs because they are much slower than NPNs.
Battery Blew up!
Ok I did the above I had +3V from 2 double a batterys.
+9V from 9volt battery.
Switch worked.
But Transistor got hot!
Then one of the double A batterys poped.
Had Negitive from 9v hooked up to negitive from AA batterys. as would be ground.
Before that I had a resistor hooked up and resistor did not get hot.
But Volts dropped and 9V relay did not work but diode did.
+9V from 9volt battery.
Switch worked.
But Transistor got hot!
Then one of the double A batterys poped.
Had Negitive from 9v hooked up to negitive from AA batterys. as would be ground.
Before that I had a resistor hooked up and resistor did not get hot.
But Volts dropped and 9V relay did not work but diode did.
Thank You.
I would like to say Thank You to everyone who has helped me with this project.
Thats a Wrap Up!
Thats a Wrap Up!