Ok I found Mouser has 74HC51s and I can manipulate a 74HC51 to act like a 74HC64 in the way it would have been used. Its getting too late to write it up tonight, Ill try to get to it tomorrow.
The heart of any state machine is a register (flip flops), it is what holds the current state's value. There are many types of registers availible. We will be using the 74HC175 which is 4 flip flops (FF) on a chip, this was chosen because it provides compliment outputs (the contents and the inverse of the contents). This eliminates the need for using inverters (NOT gates) because the inverse of all state bits are provided by the chip.
The other type of chip that will be used is the 74HC51, this is a special chip which mimics the logic equations we have written (IOW it ANDs some terms together, then ORs some of the outputs of the ANDs), attached is a logic diagram of what it does:
Notice the OR is actually NOTed before outputing (this is what the bubble on the output of the OR gate means, it's a NOR), this is opposite of what we want, but since the 74HC175 provides the value of the FF and the NOT of the value, its OK. The register will hold the NOT of the bit's state and we will consider the NOTed output to be the true output and vice versa. (IE a FF whose value is 0 means the light is on, and 1 means its off, but reading the NOT output we will get the correct state.
As you see it fits nicely with the logic equations we've made, the logic equations for the Top and Middle light will fit onto 1 74HC51, the one that uses the three inputs to the ANDs will tie the unused inputs to 1. The Bottom light however has 3·AND products ORed together. So we will feed the 3 product ANDs into the 3 input ANDs of the chip and feed the two input AND into one of the 2 input ANDs of the chip. But the output remember is a NOR when we wanted a OR, so theres a problem feedng the output of one section of the chip into the other.
In the final installment I'll show you how to solve this problem without having to add another chip, and finally post a schematic.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ ·1+1=10
Post Edited (Paul Baker) : 3/22/2006 7:45:18 PM GMT
where is good place to get the parts I need cheap? depending on price I could order some of them now. So as to be ready once you have the schematic done.
Mouser, the 74HC175·(Mouser part number·595-SN74HC175N) is 48 cents, and the 74HC51 (Mouser part number·511-M74HC51) is 28 cents (you'll need 2).
Before you go buying the chips, I want you to verify that the 555 you have is wired up properly and is producing a 1Hz signal (it will be used to generate the clock signal), you can do this by attaching a resistor and LED to the output and watch it be on for a half second and off for a half second. I dont want you ending up realizing you need more parts to make your 555 work properly and have to order again.
I have 555 chips but their already installed in other boards, like my vader voice changer circuits.
I can get the 555 chips locally here. I will need to know how to wire up the 555 chips to get the signal you mentioned.
I'll head down to the local Radio shack and pick up a couple 555 chips. They have em in stock. I have a break down of a 555 chip on another site. Do I hook up the resistor, inline with the power supply?
thanks again
Post Edited (ydeardorff) : 3/22/2006 9:23:03 PM GMT
OK, since you want a 3V supply, you'll need to use something compatible to the 555 but can work at 3V (min for 555 is 4.5V).
The ALD1502 is one such device availible from mouser for $1.50 585-ALD1502PAL.
If you look on the 4th page of the data sheet: http://www.aldinc.com/pdf/ALD1502.pdf
you'll see a circuit for Astable Mode Operation (50% duty cycle). The frequency is f=1/(1.4RC), so if you choose a 10 uF capacitor, a 75kΩ resistor would get you near 1 second frequency. The output is taken from pin 3. If you have capacitors lying around, you can choose a resistor value that would result in 1 Hz freqency and use that capacitor instead.
The register updates it's contents on the rising edge of the clock, a cycle is measured by both the on and off period. For a clock oscillating at 1Hz and having 50% duty cycle (the measure of the of time on vs the time off), will result in 1/2 second on, 1/2 second off. Since the rising edge only occurs once during the entire period, the register will update it's contents every second.
We last left off with a problem, the 3 term expressions of the bottom's light state was the inverse of what we wanted. You may have noticed that there is one FF left unused, so why dont we use the same trick as we did with the other state logic? There's a problem with that, because the output only gets updated each clock cycle, so the inverted signal gets to the other part of the logic one cycle too late.·But the states progress from one predictable state to another, so if we know the present state, we know the previous state, the state before that and so on. So since the logic for that part of the equation will be delayed one clock cycle, well rewrite that part of the equation in terms of the state before the current state, that way we will compute the answer to that part of the equation the clock cycle before we need it and it will be ready for us we we need to use it.
So looking back at the original table, bmT + Bmt + MT becomes (bmT + BmT)-1 + MT. Where the -1 stands for a clock cycle delay. Simplifying the equation we get (mT)-1 + MT for the bottom light. Now we dont even need to use both of the AND gates, we tie·the unused one·to ground so it doesnt affect the equation, and we are done. All thats left is the wiring diagram, and it is attached below.
The schematic software didnt draw any wire connection bubbles for the top 74HC51, but all connections are as they appear, no funny "hidden" connections exist.
The wires marked T M B are the top, middle and bottom light signals respectively.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ ·1+1=10
Post Edited (Paul Baker) : 3/23/2006 3:31:19 AM GMT
Make sure you downloaded the most recent copy, Ive corrected a few errors in the schematic. The LEDs you will hang off of T,M and B, dont forget to include a resistor inline with the LEDs to limit the current so they dont burn out, what value to use depends on the forward voltage drop and the maximum current they can handle. The arrows pointing down are ground, the arrows pointing up are 3V. The Clk is fed by the timer chip.
OK Ive updated the schematic to show the LEDs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ ·1+1=10
Post Edited (Paul Baker) : 3/23/2006 3:33:14 AM GMT
I have some variable resisitors left over in my ITT box, so I can dial them up slowly until I get the correct ullimination, then measure them with a fluke to get the correct resistor needed, using my breadboard. That is unless you have a better/ easier way.
Grrr, I think thats the last time I use ExpressPCB's schematic software for anything other than the simplest layouts. It places wire connection bubbles in an unpredicitable fashion, sometimes drawing them sometimes not (yet the software shows it is there, exporting the bitmap of the schematic doesn't show them). That is irksome to the highest degree, the schematic is almost unreadable since placing the LEDs in there (Top light doesnt show which verticle signal line its connected to). At least Eagle PCB allows you to explicitly place wire connection bubbles.
Ok, Ive been able to clear up the confusion with the top light connection using the "place a new pin" button, but this isn't what you are supposed to have to do and it still didnt fix the C2 and D2 connections of the top 74HC51. Heres the new schem:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ ·1+1=10
Post Edited (Paul Baker) : 3/23/2006 1:33:07 PM GMT
ok got it, Im going to have to break it up into pieces so I can print it, while Im in paint brush anyway, Ill place the connection dots in there on C2 and D2.
Ok so the connections are Q1 to D2, and Q2 to C2 for the two mising connections?
Thanks again
Post Edited (ydeardorff) : 3/23/2006 10:40:19 PM GMT
· Just wondering WHY this part can't/won't be done with a STAMP (say, oh... a BS1).· · Thought that's what it's all about [noparse][[/noparse]3 pages later...]
Because he doesn't own one (even if he does this solution costs $2.50, making a permanent install more feasible). Im a strong advocate of the right tool for the right job, no sense in using a sledgehammer to hang a picture hook.
Also he wants 3V operation, which isnt possible with a stamp, this will reduce the number of batteries required in half and reduce the amount of generated heat from a circuit he will be placing on his chest for hours at a time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ ·1+1=10
Post Edited (Paul Baker) : 3/24/2006 4:40:12 AM GMT
The Sandbox Topics related to the use of Parallax products but not spedifically addressed by an individual forum. (sic)
Paul Baker said...
this solution costs $2.50...
this will reduce the number of batteries required in half and reduce the amount of generated heat from a circuit he will be placing on his chest for hours at a time.
· Oh, yes!· Doing the Lord's Work you are. · "Generated heat", "hours at a time" -- ROTFLMAO.· Are you serious??
PJ Allen, what have I ever done to you to raise your ire? I see you throwing snide comments around like party favors (Your "use the force" comment to ydeardorff is an excellent example, and yes I understand that it was phrased as a joke considering the topic of discussion, but sarcasm and slanted jokes are best left out of the forums because alot of the original meaning and context is lost when only presented in written form), and I dont think your comments help the situation or the communal spirit Parallax is trying to foster on these forums one bit.
Yes, this project could have been done with a basic stamp, but it would have been overkill. Should I always force overdesigned solutions on people? Yes, this forum is technically for discussions related to Parallax products, but I am a customer in good standing and frequently get words encouragement and thanks from the staff. I think they will show some lattitude towards me when I occasionally don't push people to a product of thiers.
There was also another purpose to my participation in this thread, I wanted to teach ydeardorff and others reading this thread the theory behind state machine design and how to implement it into a practical and working circuit. I could have just told him to buy a BS1 and pointed him to Jon's state machine program posted in the ParallaxEFX forum and been done with it. Ydeardoff would have a working circuit, but wouldn't have learned anything from that. There is way too much of a script-kiddy additude going around these days, with people only intersted in results. If I always cater to that desire (Im not saying ydeardoff is one, he obviously did the whole Vader voice by himself), I am encourging people to take the easy way out. Id like to feel like I am elevating people's knowledge in the subject so that one day they will start answering peoples questions rather than just asking them.
I understand how somethings I say may come across as messianic, and I guess there is a higher truth and purpose to my participation in the forums, but it's certainly not religious in nature. Its that I get a personal feeling of satisfaction whenever someone expresses thanks for the help I provide them. I am presently stuck in a job that is very one dimensional, that doesn't excercise 99% of my accumulated knowledge. I became an active member of these forums so that my knowledge doesn't atrophy, and perhaps teach a few others some of it along the way.
Your·title "Highest Without Praise" I interpret as·your expression that you feel undervalued on these forums, perhaps people would express appreciation more if you kept your unhelpful comments to yourself more often. I often times decide to bite my tongue when I am tempted to post something unhelpful when I am frustrated or offended by someone on the forums, though there are times such as this that I feel the need to respond. I think you would best be served if you expressed a little more discretion in your posts.
This is my opinion, and only my opinion, take it for what you will, but I am done with this conversation. I will try to stay out of your way in the future and let you be.
-Paul
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ ·1+1=10
Post Edited (Paul Baker) : 3/24/2006 1:23:03 PM GMT
· Ire?· What ire?· What do you know from ire, Paul Baker?
· Post Scriptum -- "summa cum laude", despite the word order, is actually translated, "with higest praise/honor".· So, "summa sine laude" is "without highest praise/honor".· At any rate, it's not a lament, but the humor/intent is more subtle than even the Latin.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
The heart of any state machine is a register (flip flops), it is what holds the current state's value. There are many types of registers availible. We will be using the 74HC175 which is 4 flip flops (FF) on a chip, this was chosen because it provides compliment outputs (the contents and the inverse of the contents). This eliminates the need for using inverters (NOT gates) because the inverse of all state bits are provided by the chip.
The other type of chip that will be used is the 74HC51, this is a special chip which mimics the logic equations we have written (IOW it ANDs some terms together, then ORs some of the outputs of the ANDs), attached is a logic diagram of what it does:
Notice the OR is actually NOTed before outputing (this is what the bubble on the output of the OR gate means, it's a NOR), this is opposite of what we want, but since the 74HC175 provides the value of the FF and the NOT of the value, its OK. The register will hold the NOT of the bit's state and we will consider the NOTed output to be the true output and vice versa. (IE a FF whose value is 0 means the light is on, and 1 means its off, but reading the NOT output we will get the correct state.
As you see it fits nicely with the logic equations we've made, the logic equations for the Top and Middle light will fit onto 1 74HC51, the one that uses the three inputs to the ANDs will tie the unused inputs to 1. The Bottom light however has 3·AND products ORed together. So we will feed the 3 product ANDs into the 3 input ANDs of the chip and feed the two input AND into one of the 2 input ANDs of the chip. But the output remember is a NOR when we wanted a OR, so theres a problem feedng the output of one section of the chip into the other.
In the final installment I'll show you how to solve this problem without having to add another chip, and finally post a schematic.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 3/22/2006 7:45:18 PM GMT
Before you go buying the chips, I want you to verify that the 555 you have is wired up properly and is producing a 1Hz signal (it will be used to generate the clock signal), you can do this by attaching a resistor and LED to the output and watch it be on for a half second and off for a half second. I dont want you ending up realizing you need more parts to make your 555 work properly and have to order again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
ok ordered, anything else I'll need? like capacitors, resisitors?
Post Edited (ydeardorff) : 3/22/2006 8:11:26 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
I can get the 555 chips locally here. I will need to know how to wire up the 555 chips to get the signal you mentioned.
I'll head down to the local Radio shack and pick up a couple 555 chips. They have em in stock. I have a break down of a 555 chip on another site. Do I hook up the resistor, inline with the power supply?
thanks again
Post Edited (ydeardorff) : 3/22/2006 9:23:03 PM GMT
The ALD1502 is one such device availible from mouser for $1.50 585-ALD1502PAL.
If you look on the 4th page of the data sheet: http://www.aldinc.com/pdf/ALD1502.pdf
you'll see a circuit for Astable Mode Operation (50% duty cycle). The frequency is f=1/(1.4RC), so if you choose a 10 uF capacitor, a 75kΩ resistor would get you near 1 second frequency. The output is taken from pin 3. If you have capacitors lying around, you can choose a resistor value that would result in 1 Hz freqency and use that capacitor instead.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
So the power supply will run into this chip first, then into the others to get the timing pulse right. correct?
is pin 5 or 7 the output voltage to the rest of the circuit?
Post Edited (ydeardorff) : 3/22/2006 9:43:22 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Im anxiously awaiting the schematic! LOL
We last left off with a problem, the 3 term expressions of the bottom's light state was the inverse of what we wanted. You may have noticed that there is one FF left unused, so why dont we use the same trick as we did with the other state logic? There's a problem with that, because the output only gets updated each clock cycle, so the inverted signal gets to the other part of the logic one cycle too late.·But the states progress from one predictable state to another, so if we know the present state, we know the previous state, the state before that and so on. So since the logic for that part of the equation will be delayed one clock cycle, well rewrite that part of the equation in terms of the state before the current state, that way we will compute the answer to that part of the equation the clock cycle before we need it and it will be ready for us we we need to use it.
So looking back at the original table, bmT + Bmt + MT becomes (bmT + BmT)-1 + MT. Where the -1 stands for a clock cycle delay. Simplifying the equation we get (mT)-1 + MT for the bottom light. Now we dont even need to use both of the AND gates, we tie·the unused one·to ground so it doesnt affect the equation, and we are done. All thats left is the wiring diagram, and it is attached below.
The schematic software didnt draw any wire connection bubbles for the top 74HC51, but all connections are as they appear, no funny "hidden" connections exist.
The wires marked T M B are the top, middle and bottom light signals respectively.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 3/23/2006 3:31:19 AM GMT
the CLK is the input from the timer chip right?
Sorry, Im just trying to get this right before I blow up IC chips. LOL
There should be a positive output to each led, then going to ground right?
or do I tap the positive lead of the LED into the TMB, or the tmb?
OK Ive updated the schematic to show the LEDs.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 3/23/2006 3:33:14 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
This could be used for hours at a time, like in the extreme, and entire day lol provided I could wear that oven of a costume that long!
Your welcome.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Ok, Ive been able to clear up the confusion with the top light connection using the "place a new pin" button, but this isn't what you are supposed to have to do and it still didnt fix the C2 and D2 connections of the top 74HC51. Heres the new schem:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 3/23/2006 1:33:07 PM GMT
Ok so the connections are Q1 to D2, and Q2 to C2 for the two mising connections?
Thanks again
Post Edited (ydeardorff) : 3/23/2006 10:40:19 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
· Thought that's what it's all about [noparse][[/noparse]3 pages later...]
Also he wants 3V operation, which isnt possible with a stamp, this will reduce the number of batteries required in half and reduce the amount of generated heat from a circuit he will be placing on his chest for hours at a time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 3/24/2006 4:40:12 AM GMT
Topics related to the use of Parallax products but not spedifically addressed by an individual forum. (sic)
· Oh, yes!· Doing the Lord's Work you are.
· "Generated heat", "hours at a time" -- ROTFLMAO.· Are you serious??
Yes, this project could have been done with a basic stamp, but it would have been overkill. Should I always force overdesigned solutions on people? Yes, this forum is technically for discussions related to Parallax products, but I am a customer in good standing and frequently get words encouragement and thanks from the staff. I think they will show some lattitude towards me when I occasionally don't push people to a product of thiers.
There was also another purpose to my participation in this thread, I wanted to teach ydeardorff and others reading this thread the theory behind state machine design and how to implement it into a practical and working circuit. I could have just told him to buy a BS1 and pointed him to Jon's state machine program posted in the ParallaxEFX forum and been done with it. Ydeardoff would have a working circuit, but wouldn't have learned anything from that. There is way too much of a script-kiddy additude going around these days, with people only intersted in results. If I always cater to that desire (Im not saying ydeardoff is one, he obviously did the whole Vader voice by himself), I am encourging people to take the easy way out. Id like to feel like I am elevating people's knowledge in the subject so that one day they will start answering peoples questions rather than just asking them.
I understand how somethings I say may come across as messianic, and I guess there is a higher truth and purpose to my participation in the forums, but it's certainly not religious in nature. Its that I get a personal feeling of satisfaction whenever someone expresses thanks for the help I provide them. I am presently stuck in a job that is very one dimensional, that doesn't excercise 99% of my accumulated knowledge. I became an active member of these forums so that my knowledge doesn't atrophy, and perhaps teach a few others some of it along the way.
Your·title "Highest Without Praise" I interpret as·your expression that you feel undervalued on these forums, perhaps people would express appreciation more if you kept your unhelpful comments to yourself more often. I often times decide to bite my tongue when I am tempted to post something unhelpful when I am frustrated or offended by someone on the forums, though there are times such as this that I feel the need to respond. I think you would best be served if you expressed a little more discretion in your posts.
This is my opinion, and only my opinion, take it for what you will, but I am done with this conversation. I will try to stay out of your way in the future and let you be.
-Paul
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
Post Edited (Paul Baker) : 3/24/2006 1:23:03 PM GMT
· Post Scriptum -- "summa cum laude", despite the word order, is actually translated, "with higest praise/honor".· So, "summa sine laude" is "without highest praise/honor".· At any rate, it's not a lament, but the humor/intent is more subtle than even the Latin.
Post Edited (PJ Allen) : 3/24/2006 1:43:32 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10