Is there such a logic circuit? - Page 1
Forum section: electronics / beginners

author: Watth
author_rank: Frequent Contributor
timestamp: September 16, 2016, 02:55:13 pm
content: Hello,I have been looking around, but couldn't find if the type of circuit I am looking for exists as a standard.- 8 outputs, all but one are LOW, the other is HIGH for example, QO is HIGH, Q1 to Q7 are LOW- onclock impulse, the high output shifts: Q0 and Q2 to Q7 are LOW, Q1 is HIGH, and so on. (if Q7 is HIGH on impulse, Q0 gets HIGH and the others LOW).- (optional: another clock impulse shifts the HIGH output the other way, from Q7 to Q0).-outputenableinput allows to turn all output LOW while active-resetreturn to Q0 HIGH and Q1 to Q7 LOW.I made a timing diagram, if it helps understanding what I mean.I think it would work as a 3 bits counter with a 3 to 8 bits demultiplexer.So does this have a name ?Thank you!

author: tatus1969
author_rank: Super Contributor
timestamp: September 16, 2016, 03:31:48 pm
content: AFAIK there is no standard 74xx logic chip that does all this. A 74xx669 plus a 74xx238 will do it. If you have space constraints you could use a CPLD instead.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 16, 2016, 03:36:52 pm
content: 4017 would do all but the output enable.Small MCU probably easiest & cheapest though, e.g. PIC12F505

author: djacobow
author_rank: Super Contributor
timestamp: September 16, 2016, 04:06:00 pm
content: If you need to go fast and backwards is not important, then maybe a 4022 followed by a buffer. Or, if cost is less important and you do need the backwards, program a 22V10.If you do not need to go very fast, then a simple microcontroller is your friend. And by fast I mean > ~ 1 MHz.You describe something called "output enable" but in your diagram it looks like you are not asking for tristate, but all zeros, is that right?

author: Kalvin
author_rank: Super Contributor
timestamp: September 16, 2016, 05:41:09 pm
content: Quote from: tatus1969 on September 16, 2016, 03:31:48 pm+1

author: Watth
author_rank: Frequent Contributor
timestamp: September 16, 2016, 07:35:17 pm
content: Thanks everybody for your thoughts on the matter.Indeed, what I am looking for is an octal counter (such asOn semi's MC14022B).I forgot to mention that, for the project I was thinking of, this will be controled by an MCU, and not an especially fast one (Arduino or ATtiny), so speed and extra features (shifting backward, output enabling) are not required.Quote from: djacobow on September 16, 2016, 04:06:00 pmDo I really need to add a buffer if the output is used as a clock signal for a flip-flop?

author: djacobow
author_rank: Super Contributor
timestamp: September 16, 2016, 08:00:36 pm
content: Quote from: Watth on September 16, 2016, 07:35:17 pmI only suggested the buffer (a tristating buffer, I should have said) because you mentioned the requirement for an output enable. Whether you need something to condition the outputs in order to act as a clock for downstream logic is a question I don't think I can answer. I suspect you don't, but do not know how well behaved the output of a 4022 is. I suspect it is quite well behaved and you will not see any glitches, but do not know for sure.In general, questions like the one you started with make people like me wonder what your overall system is about, because often enough, people head down a path of system design, then get some strange requirements based on that, and come on a message board and ask what can meet X requirements. But there is every possibility that the solution to the question asked may represent a local optimization and a global non-optimization.That is, you've gotten a decent answer to your question, but you might get an even better one if we knew what you were trying to accomplish.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: September 16, 2016, 08:16:13 pm
content: Quote from: tatus1969 on September 16, 2016, 03:31:48 pm^ thisObscure digital logic is just asking for a CPLD. Xilinx Coolrunner-II 32 MCell can be had for $1.50 in single quantities and will do any bit shifting/flipping/tristating that you ask it to do, at high speeds, for relatively little power, with configurable interface voltage and pinout.

author: djacobow
author_rank: Super Contributor
timestamp: September 16, 2016, 09:58:34 pm
content: Quote from: suicidaleggroll on September 16, 2016, 08:16:13 pmGenerally, but we don't know anything about this guy's project. Maybe he needs TH parts, or doesn't know how to program a CPLD or SPLD for that matter (or doesn't want to learn), or doesn't want to get a programmer because this is a one-off, etc.I'll agree, he has hinted that there is more logic downstream, so a CPLD may be the ticket to solving not just this counter problem, but also sucking in the rest.

author: onlooker
author_rank: Frequent Contributor
timestamp: September 17, 2016, 02:10:03 am
content: I was a little confused by the OP's description. But, the OP may try a serial-in and 8 bit out shift register such as SN74HC595 or the like. Then, using the last stage to drive the serial-in properly to make the 8 outputs cyclic following the clock edges. At initialization, set the output to 10000000.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 17, 2016, 05:21:18 am
content: Up/down counter e.g. 'HC198, plus decoder e.g. '154.Tim

author: Watth
author_rank: Frequent Contributor
timestamp: September 17, 2016, 05:53:13 pm
content: Quote from: djacobow on September 16, 2016, 09:58:34 pmIndeed, it needs more context!This is a self learning hobbyist's project.For example I made simple break-out-boards- such as a 595 with LEDs on each outputs, so that I can exercise using one by commanding it with a µCU. The same way I made a board for a 165 (parrallel to series) with an 8 bit DIP switch to see how I can recover data with a µCU. Learning by trial and error. I prefer using SMT to THT.So now this project is an exercise in making a 64 (8x8) LED matrix controled by an µCU.I am not definitive on how I will make it, thus the lack of information concerning other technical aspects.What I can say is I chose a flip-flop for each LED in order to get rid of having to permanently refreshing the matrix.I am not decided of how I will adress them, although 595 and/or 4022 are probably what I'll go toward to.I make my own code, which incidentally frees me from having to adapt hardware to existing libraries.I'll try to us as little as possible pins, as I wish to be able to command it with a limited pin number ATtiny.Considering the original question, as far as I have seen, an octal counter (4022) is what I am looking for.Another thing I wonder: if one wanted to cycle not 8 bits (or 10 for a decimal counter), but say 5 bits (Q0 to Q4); would you recommand connecdting Q4 to Reset as a solution?Attached: the BoB I made for the 165 serial to parallel.

author: ebclr
author_rank: Super Contributor
timestamp: September 17, 2016, 06:08:35 pm
content: This can do what you want and a lot morehttp://www.ebay.com/itm/Altera-MAX-II-EPM240-CPLD-development-board-learning-board-breadboard-GM-/262136734017?hash=item3d08912141:g:aZMAAOSwFNZW1Wh3

author: David Hess
author_rank: Super Contributor
timestamp: September 17, 2016, 08:49:16 pm
content: I do not think you will find it as a single integrated function. The 74LS299 comes close but it would be easier to use an up/down counter driving a decoder because it will be easier to start at a known state. A CPLD is probably the way to go and will be less expensive anyway.

author: djacobow
author_rank: Super Contributor
timestamp: September 17, 2016, 11:15:42 pm
content: Quote from: Watth on September 17, 2016, 05:53:13 pmAh, ok. So, the good news is that there are about a zillion different ways to do this, so you should definitely feel fine going about it however you like!I have had good luck driving an 8x8 and a 16x16 using nothing more than 74HC595's -- for both the horizontal and the vertical. For one axis, you shift in the needed bit pattern. For the other you shift in a 1 and all zeroes, depending on the row you want to light. You can actually shift both the column and the row simultaneously, saving time. You do need to be careful and not RCLK the one-hot axis while you are still messing with the other one, but with a little fooling around and appropriate use of RCLK and /OE, you can figure it out. You can probably get by with driving the LEDs from the 595's directly, but for more drive strength you can drive P device on one axis and N devices on the other. I have a wall clock in my office I made just this way. The display is painted by an ISR that runs at a fixed frequency and adjustable duty cycle.Have fun!

author: danadak
author_rank: Super Contributor
timestamp: September 17, 2016, 11:53:20 pm
content: You can do all this and much more in a Cypress PSOC.Cypress PSOC has ARM core, A/D (SAR and DelSig), DSP, logic fabric that can be used ata GUI level or programmed in Verilog (much more important in future career), DMA, OpAmps,PWM, COM, onboard Vref......see attached "component" list. In PSOC a component is a pieceof onboard HW. PSOC has LUTs and basic gates, counters, shift regs....you can either configwith GUI tool or program in Verilog. Tons of training videos, tool has many example projectsolutions you can draw from. All components come with APIs you use in code to operate thevarious components.You can even design your own components, as well as program DSP engine in ASM to createhigh performance custom DSP designs. DSP is a separate core inside PSOC.Component list attached, as well as an example using DSP to filter a signal. Note this only useda small %age of the resources, eg. one could have added a lot more functionality to the project.Keep in mind you route the signals internally and to pins, with the GUI tool. its its ownbreadboard, FPGA like.SW tool free, low cost boards, $ 10 - $ 25.Regards, Dana.Notice counters, shift registers, mux/demux all in component library. In library a LUT you canprogram (GUI tool) to do all that, leaving you 95% of the rest of the chip to use.

author: rstofer
author_rank: Super Contributor
timestamp: September 18, 2016, 01:49:16 am
content: if the real objective is to drive an 8x8 LED array, how about the MAX7219Here is a project:http://www.best-microcontroller-projects.com/max7219.htmlHere is a datasheet:https://www.sparkfun.com/datasheets/Components/General/COM-09622-MAX7219-MAX7221.pdfAll the uC brings to the dance is the smarts and an SPI interface that can run as high as 10 MHz.Notice that under certain conditions, the units can be daisy-chained.

author: David Hess
author_rank: Super Contributor
timestamp: September 18, 2016, 07:39:48 am
content: Quote from: djacobow on September 17, 2016, 11:15:42 pmIt would be cute to use the latch command of the 74HC595 to also increment a counter which drives the row/column select.Note that multiplexed displays can be more energy efficient if the drive current is closer to the peak of the LED efficiency curve.