Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I'm exhausted, and a newb...

Status
Not open for further replies.
Here's an alternate approach using a 4-16 demux, for active low, it's a single chip solution and has very straight forward wiring. You can use any of the 74xx154 variants - I'd go for a 74HC154.

by the way, USB joysticks are pretty common and I suspect the chip is hidden under an epoxy blob (COB tech).
 

Attachments

  • 4-16.GIF
    4-16.GIF
    10.2 KB · Views: 262
Last edited:
ljcox:

Thanks for your diagrams, this is helping me understand active high and active low a little better... not an easy concept to grasp. You got any literature on this topic specifically?

My understanding though (ACTIVE LOW) is when current flows to the input of the IC, the output is going to be '0', but when the current is interrupted to the input of the IC, the output will then become '1'. (like a normally closed relay, when receiving current, the remote circuit is open, when the current is stopped to the coil of the relay then is normally closed and '1'.) Is this correct for Active low? Obviously Active HIgh is opposite.


I've attached two pics of the joystick opened up (yes its definately USB, not serial or anything like that)... but I really cant see any IC's.... there are two black roundish epoxy blobs... but they really do look too small to have a chip... although I could be wrong considering the size of IC's these days.

**broken link removed**
**broken link removed**

I see from your diagram that in the active high circuit you use 74hc02 and the active low you use the 74hc32, and I see on the PDF of these chips that they either have active high/low outputs respectively... thats easy... what I dont understand though is that you are using the same IC 74hc08 for both active high and active low circuits.... and that IC seems to be active high, so surely it wont work correctly on the active low circuit?

philba:
Thank you for your very easy to understand drawing, I'm very grateful for your efforts!

Question: What exactly are the resistors needed for, I see you're dropping the voltage before the inputs to the IC, is 5v too much??? How does this work?

Question2: you've drawn switches S1-S4 with another little symbol above the actual switch symbol, the little squiggle and the sideways 'T' (sorry for the stupid description)... what does that represent? Sorry for all the stupid questions!!!

Question3: You have used the 74151N IC, how on earth do you know what IC to look for out of the many thousands they make??! ALso, the solution to my problem requires AND's and NAND's/NOR's according to ljcox and my friends logic diagram. Does this IC have these? I looked at the datasheet online and my God, I was very confused by the linework logic diagram within the IC... I dont know how you know what outputs to pick....

ljcox: I take it the HEX inverted IC will convert active High/Low inputs to its opposite logic?
 
They're the cheapest way of putting a chip on the board; no plastic package, just wire the chip to the board and cover with a blob of resin!

Many small cheap electronic goods use this method, TV remote controls, calculators, LED flashers and sound effects ICs in toys, etc.
 
the resistors are to pull the input high when the switch is open. this is important as a floating input (no connection) can go either way. You can use any resistor in the range 4.7K to 100K. I usually use 10K because I bought a whole pile of them.

active high vs active low is basically just an inversion. nand and nor (not and, not or) logic was slightly easier to use. Also, active low was used in bus configurations where you could have multiple devices connected to the same wire where pulled high was the default state (0).. I wouldn't worry too much about it.

edit: to answer the switch question - that was just the first spst switch symbol I found in the eagle libs.

on finding logic parts. It helps to have a degree in computer and electrical engineering... lol. seriously, there are a number of sites that describe the different types of logic - there are a small number of basic types: and/nand, or/not, inverters, multiplexors, demuxs, flipflops, buffers, shift registers, counters and a few more. Once you understand how each works, they go together like legos, well, sort of...
 
Last edited:
Franknstein said:
ljcox:

Thanks for your diagrams, this is helping me understand active high and active low a little better... not an easy concept to grasp. You got any literature on this topic specifically? You're welcome. I have a paper written in 1969 that explains the concept. I'll find it later, scan and post. Did you read the "gating paper" that I attached?

My understanding though (ACTIVE LOW) is when current flows to the input of the IC, the output is going to be '0', but when the current is interrupted to the input of the IC, the output will then become '1'. (like a normally closed relay, when receiving current, the remote circuit is open, when the current is stopped to the coil of the relay then is normally closed and '1'.) Is this correct for Active low? Obviously Active HIgh is opposite.
Don't consider the input current. The input voltage is the important issue. For CMOS, the input resistance is very high so there is virtually no input current. Also, it is less confusing to use High and Low rather than 1 & 0 since in positive logic, H = 1 & L = 0, but in negative logic, H = 0 & L = 1. High and Low refer to the voltages not the logical values, ie. H & L are physical attributes of the IC.

The Active High (AH) and Active Low (AL) refers to the input conditions to make a gate "active" For example, an AND gate is active when both inputs are High. ie. a H and a H makes the output H. So the output is AH, ie. the output condition when the gate is "active".
A NAND gate is "active" when the inputs are H & H but the output is L. So the output is AL. Read my gating paper for all the combinations.


I've attached two pics of the joystick opened up (yes its definately USB, not serial or anything like that)... but I really cant see any IC's.... there are two black roundish epoxy blobs... but they really do look too small to have a chip... although I could be wrong considering the size of IC's these days.
As others have said, the blobs are ICs.

I see from your diagram that in the active high circuit you use 74hc02 and the active low you use the 74hc32, and I see on the PDF of these chips that they either have active high/low outputs respectively... thats easy... what I dont understand though is that you are using the same IC 74hc08 for both active high and active low circuits.... and that IC seems to be active high, so surely it wont work correctly on the active low circuit?
Read the gating paper. It shows how eg. an OR gate can be used to do either the OR function or the AND function. In the former case, the inputs are AH and the output is AH, but in the latter, the inputs are AL and the output is AL. Look at the truth table. H or H gives a H at the output. But when the inputs are L & L the output is L, hence it can be used to do the AND function.

philba:
Thank you for your very easy to understand drawing, I'm very grateful for your efforts!

Question: What exactly are the resistors needed for, I see you're dropping the voltage before the inputs to the IC, is 5v too much??? How does this work? The resistors are "pull up" resistors. The input to a gate must be either H or L. If you use a switch (as you are) to generate the input signal, you need a pull up resistor, otherwise, the IC won't see any change of voltage when the switch is thrown from open to closed or from closed to open. With the PU resistor, the input is "pulled" to +5V when the switch is open and "pulled Low when it is closed.

Question2: you've drawn switches S1-S4 with another little symbol above the actual switch symbol, the little squiggle and the sideways 'T' (sorry for the stupid description)... what does that represent? Sorry for all the stupid questions!!!

Question3: You have used the 74151N IC, how on earth do you know what IC to look for out of the many thousands they make??! ALso, the solution to my problem requires AND's and NAND's/NOR's according to ljcox and my friends logic diagram. Does this IC have these? I looked at the datasheet online and my God, I was very confused by the linework logic diagram within the IC... I dont know how you know what outputs to pick....
Look at the truth table in the data sheet.

ljcox: I take it the HEX inverted IC will convert active High/Low inputs to its opposite logic?
You mean the 74154 or 74HC154. Yes, these ICs have AL outputs. You said you needed AH. So and inverter will invert the signals, ie. H becomes L and vice versa. I recommend you use the 74HC154 since it has adequated output drive to cope with what ever type of technology is in the JS. A 74154 is a TTL device (as it the 74LS154) and so you may have interfacing problems.

I suggest you forget about the 74xx154 for the moment and try to thoroughly understand my circuits. Then you will be in a better position to understand the 74xx154 ICs.
 
philba said:
the resistors are to pull the input high when the switch is open. this is important as a floating input (no connection) can go either way. You can use any resistor in the range 4.7K to 100K. I usually use 10K because I bought a whole pile of them.
30 years ago when I was desgning electromechanical systems and interfacing them to electronics, the rule of thumb was that contacts (ie. switch contacts or relay contacts) needed at least 5 Volt across them when open and at least 1 mA through them when closed.

This was to ensure adequate contact "wetting".

I don't know if this still applies these days as relay and switch contacts are often sealed, ie. not open to the atmosphere. But I prefer to be safe rather than sorry hence the 4k7 pullup resistors.
 
philba said:
active high vs active low is basically just an inversion. nand and nor (not and, not or) logic was slightly easier to use. Also, active low was used in bus configurations where you could have multiple devices connected to the same wire where pulled high was the default state (0).. I wouldn't worry too much about it.
I disagree. You can simplify logic circuits by using the AH/AL concepts.

For example, after learning this technique in 1969, I simplified a circuit designed by someone else from needing 12 ICs to 4 ICs.

He had used NAND gates only and, because some signals were AH when he needed AL, etc., he needed many inverters.

I replaced some of the NANDs with NORs and thus eliminated most of the inverters. I also made better use of some of the available signals.
 
Here is an extract from the paper I mentioned.
 

Attachments

  • Logic Circuits.pdf
    45.9 KB · Views: 266
I'm not sure what you are disagreeing with. This isn't rocket control, it's just a couple of signals. If you dispute "not worrying about it" then you surely took my comments out of context - ah vs al is not some mysterious thing. that's all I was saying to him.

But I slightly disagree with your suggestion of an ssi solution (and/nand/on/nor) - 4-16 demux is simpler to wire up and far easier to understand. even if he has to put inverters on the mux outputs. chasing though the terms of your solution is much harder for a newbie to understand. Either one will work but I'm trying to be thoughtful of the OP's experience level.

By the way, the best way to simplify is to use karnaugh maps to pluck out the relevant terms. but that's well beyond this problem.
 
philba said:
I'm not sure what you are disagreeing with. This isn't rocket control, it's just a couple of signals. If you dispute "not worrying about it" then you surely took my comments out of context - ah vs al is not some mysterious thing. that's all I was saying to him. What I was trying to say is that the AH/AL concept is very useful.

But I slightly disagree with your suggestion of an ssi solution (and/nand/on/nor) - 4-16 demux is simpler to wire up and far easier to understand. I agree. If you go back a few posts, you will see that I said that your's is a good solution.
even if he has to put inverters on the mux outputs. chasing though the terms of your solution is much harder for a newbie to understand. Either one will work but I'm trying to be thoughtful of the OP's experience level. My point is that if he understands my solution, he will then be in a better postion to understand the logic diagram and truth table in the 74HC154 data sheet.

By the way, the best way to simplify is to use karnaugh maps to pluck out the relevant terms. but that's well beyond this problem.

I used Karnaugh maps to derive the circuit I posted.
 
Just sat this morning sifting through all your replys and spending some time on wikipedia and looking through all your pdf's etc. I am pleased to say I finally understand the concepts. Its actually fairly easy when you break it down, but I am definitely not at a stage where I wont need reference to build anything. Thanks again for all the input/drawings/pdf's and papers, they were extremely useful.

I will be visiting the electronic supply store tomorrow and will pick up IC's for both yours solutions. I think I will use Philba 4-16 demux chip for the final circuit, but in order to experiment and gain more understanding of how these chips work, I will experiment with ljcox's solution too.

Next up and am going to interface another circuit I've built with a 4511, and it will need to tell you which gear you are in at the time. As soon as I have the primary gear switching circuit ready then I will do the complete circuit diagram and run it by you guys, I want to see if I can do it by myself.

Hope to have some results by tuesday.

laters
ryan
 
Ok, I've finally finished wiring everything up, I built the circuit on a piece of stripboard.

I tapped into the V+ of the joystick (my meter reads 2.5v from the power of the joystick to the common of all the gear1-6 switches on the joystick board). There is another black wire on the board which has NO continuity to the gear 1-6 common, but when I read the Voltage across that main black wire and the joystick V+ its about 4.5volts.

I've connected the circuit GND that I built to the 2.5v gear 1-6 switch common.

I think something I've done is very wrong, because I am getting continuity through every single switch output all the time when the circuit has power (no continuity on any of them when the power is off (this part seems right).

Please help!
 
hi ryan,
Which version of the circuit are you referring to?

Any diagrams to post, will help.
 
**broken link removed**
Here it is:

basically, when joystick is unplugged... I get no continuity between the terminals of wire Z and each of the blue wires . this is correct

when plugged in, there is continuity on all of them (wire Z, and each blue wire)
this is wrong, as its trying to push all 6 joystick buttons at the same time.

the red wire is the power supply from the USB, and the black is the USB power GND. When I put a my meter across wires X and Y, I get about 4.5v. When I put my meter across Z and Y, I get 2.5V when none of the S1/S2 etc are active.

EDIT: there is never any continuity between Z and X

I think I've wired something incorrectly...
Help! Please!

Thanks
 
Last edited:
hi,
I havnt been following this post for a couple of days.

The 74154 is a TTL device, with active low outputs. I thought philba recommended a CMOS version of the device???

The outputs will be high, around 3 to 4 volts when none of the S1 thru S5 push buttons are pressed.
To set '5' low,[1st] both S1 and S3 must be pressed.

I'm sorry this help is limited, I'll look thru the back posts and try to get up to speed.

EDIT: I assume that you have got the +5V and 0V lines connected to the 74154?
I have got to ask, just in case!
 
Last edited:
Hi Eric

I am using the 74HC154. Which is CMOS right? Sorry, I just used philba's attached diagram which had 74154 as the label from the beginning.

The V+ and V- are connected, forgot to add that to my diagram, V+ is common with red wire on my new diagram and V- is common with wire 'z' on my new diagram.

please check the above diagram again, I have updated it with the Vcc and GND connected, and the full name of the chip.
tnx
 
Last edited:
hi ryan,
Understood.

Looking back at your earlier posting.
>> I tapped into the V+ of the joystick (my meter reads 2.5v from the power of the joystick to the common
of all the gear1-6 switches on the joystick board).

The Common of the S1 to S6 should be at 0V [Gnd], not 2.5V

>>
There is another black wire on the board which has NO continuity to the gear 1-6 common, but when I read the Voltage across that main black wire and the joystick V+ its about 4.5volts.


This Black wire is the 0V [Gnd] and should be connected to the 0V of your pcb, pin 14 of the 74HC154 and the S1 to S6 Common.

Recapping:
The RED wire +V should goto the top of the resistors, as you have shown and pin 24 of the 74HC154.

The BLACK wire 0V should goto the Common of S1 thru S6 and pin14 of the 74HC154.

Dont use your meter on Continuity to test the circuit when the ic's are connected.

Remember when you have connected as described, the output pins of the 74HC154 without any gear switches pressed will be high, about +4V.
The selected output will goto 0V when the correct gear switch is pressed.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top