9
\$\begingroup\$

I am wondering if a logic gate would be of use to a circuit that contains a micro-controller.Are there cases when an analog logic gate is preferred over a micro-controller and what are some of the gadgets that use analog logic gates in the age of micro-processors and controllers.

\$\endgroup\$
  • \$\begingroup\$ What is an "analog gate", a digital gate in a separate chip (74HC00 etc)? Or an analog switch or selector chip (CD4066 etc)? \$\endgroup\$ – Wouter van Ooijen Nov 7 '14 at 14:28
  • \$\begingroup\$ I mean your ordinary OR or AND or NOR gate. \$\endgroup\$ – jsjsjsjsjsjs Nov 7 '14 at 14:30
  • 2
    \$\begingroup\$ 'analog logic gate' means a gate with a statistical analog function e.g. In an analog logic XOR gate (“soft XOR gate”), the inputs to the gate are actually determined by the current proportionally to the probability that the input is logical “1” or logical “0” google.com/patents/US8742794 and a few research papers \$\endgroup\$ – Pete Kirkham Nov 7 '14 at 14:33
  • \$\begingroup\$ Thanks to everyone who answered or commented.Your answers were really helpful. \$\endgroup\$ – jsjsjsjsjsjs Nov 7 '14 at 14:51
14
\$\begingroup\$

I think you mean a 'discrete' logic gate.

Yes, there are reasons you may wish to use an external gate. I'll take an actual example: I have a microcontroller that controls a clock signal to some external boxes. It must turn the clock (several MHz) on at a time determined by the microcontroller and must not feed out any 'runt' pulses. By synchronizing the enable with the clock generator (a flip-flop) and gating it (an 'and' gate), the specifications can be met. There's no way to do it with just the micro.

In another case, an external signal from a comparator should be enabled by a timer in the microcontroller. The microcontroller peripheral has the ability to precisely (in time) toggle its port pin, but no ability to 'and' signals with that pin state.

In some cases, microcontrollers have been fitted with some configurable logic to take care of this sort of requirement (the 'CLC' or 'configurable logic cell') on Microchip parts, for example), but there will always be applications where the micro maker did not anticipate the application. In fact, sometimes we tie an entire FPGA with hundreds of thousands of gates to the micro to get enough external logic to meet the requirements.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Cypress Semiconductor has really cool PSoC with those sort of CLC on them, I wonder if they can deal with these issues .. Atmel just came out with their ARM Cortex M0, the D20 series, which as fully configurable communications subsystem blocks but that's not quite relevant haha. \$\endgroup\$ – KyranF Nov 7 '14 at 14:59
  • 2
    \$\begingroup\$ @KyranF The 364kg gorillas in the toolbox now are the Zynq chips from Xilinx. A good-size FPGA with a dual-core 32-bit ARM A9 on-chip. \$\endgroup\$ – Spehro Pefhany Nov 7 '14 at 15:08
  • \$\begingroup\$ Wow, not for $70 it's not! Looks really good though. The cypress chips are also available in non BGA packages, for those with less professional equipment to deal with. I guess a huge project would benefit from the series power of FPGA + dual core A9. Like a huge control station with many interfaces perhaps. \$\endgroup\$ – KyranF Nov 7 '14 at 15:14
  • \$\begingroup\$ @KyranF We're using them to do some heavy-duty signal processing. Just a little (but expensive) airborne box with an Ethernet port and some sensors. ;-) \$\endgroup\$ – Spehro Pefhany Nov 7 '14 at 15:36
  • 1
    \$\begingroup\$ Atmel's Xmega E devices have a bunch of glue logic (XCL) built into the chips that interfaces with the core in several ways. \$\endgroup\$ – Ignacio Vazquez-Abrams Nov 7 '14 at 17:40
8
\$\begingroup\$

Digital logic gates ("analog logic gate" makes no sense) are still sometimes used with microcontrollers. Usually the reason is that something needs to be done at the speed of a logic gate that firmware is too slow for. Another possibility is expanding the I/O capabilities of the micro. If you have several devices on a bus, for example, you will probably have external logic that latches data to and from the bus. There may also be external logic to handle arbitration, since this often has to happen at the speed of bus cycles or fractions of a bus cycle.

| improve this answer | |
\$\endgroup\$
5
\$\begingroup\$

Another reason: ultra low current consumption when not switching. You could use this to respond to simple input when the micro is off, or decide whether to wake it up to perform processing.

| improve this answer | |
\$\endgroup\$
5
\$\begingroup\$

Microchip has determined that enough designers need to add some peripheral "glue" logic to their designs that they have come out with two microcontroller families -- PIC16(L)F150 and PIC10(L)F32X -- which include up to four Configurable Logic Cells (CLC), much like a miniature CPLD.

enter image description here

There are eight different logic functions available:

• AND-OR
• OR-XOR
• AND
• S-R Latch
• D Flip-Flop with Set and Reset
• D Flip-Flop with Reset
• J-K Flip-Flop with Reset
• Transparent Latch with Set and Reset

For example here is a J-K flip-flop:

enter image description here

In the case of the PIC10 (which has one CLC), that's pretty amazing for a six-pin device that costs under 40ȼ in quantity. At that price, the cost and space saving over having to include several separate logic chips adds up.

| improve this answer | |
\$\endgroup\$
5
\$\begingroup\$

On one hand, "discrete" logic can perform faster and more reliably operations that could otherwise be done by a microcontroller. And, which sometimes is even more important, logic gates can operate concurrently, while a uC is inherently sequential.

Also, if you have a crowded board you can save I/O pins on the microcontroller if you can perform such operations externally.

| improve this answer | |
\$\endgroup\$
3
\$\begingroup\$

To add to the list of applications, they're also useful when dealing with input signals faster than you could process directly in the microcontroller. For instance, on a board I'm working on at the moment, a phase detector - simply an XOR gate - with a resistor and capacitor allows the MCU to read out the relative phase of two signals using its ADC, instead of having to sample the whole high speed signal.

| improve this answer | |
\$\endgroup\$
2
\$\begingroup\$

Everybody has ignored op-amps here; analogue logic has many functions even in modern uP / micro controller circuits. Proprietary signals via long wires between micros would be just one application. Personally I work on security and other electronics all the time where I have to sort out bad designs by highly qualified Engineers because of their lack of understanding of op-amps and discreet logic.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Analog signal processing is still not logic, which deals with discrete values. \$\endgroup\$ – Colin D Bennett Nov 8 '14 at 6:23
  • \$\begingroup\$ Op-amp integrators and differential circuits are calculators, and comparators and schmidt triggers provide interfaces between analogue and digital circuits. They perform logic functions in all sorts of ways. \$\endgroup\$ – intelec7 Nov 8 '14 at 7:01
  • \$\begingroup\$ And just to be difficult logic circuits are analogue circuits. They, like op-amps are just very high gain analogue circuits. If you do not take that into account when designing with them then it all turns bad. \$\endgroup\$ – intelec7 Nov 8 '14 at 7:05
  • \$\begingroup\$ I think you mean discrete; discreet logic is something else entirely. ;) \$\endgroup\$ – Nick Johnson Nov 28 '14 at 15:46
2
\$\begingroup\$

They are also used for safety logic, to keep the whole complexity of software out of the critical path. In this laser cutter board for example, to turn off the laser.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.