|
Simple question: If you can build a circuit with discrete logic or simply program a cheap microcontroller and be done with it, what would you do?
Discrete logic costs next to nothing, but can very quickly hog up expensive space on your circuit board and complicate the board's layout, including problems with noise on the signals.
The microcontroller often comes in the same price category as the discrete logic chips it is supposed to replace. It's a single chip that has to be programmed to perform the function you want to have it for. It may solve the problem more elegantly than some bare bones logic could. Then again, a microcontroller with internal ROM and RAM and often diverse I/O ports seems a little wasteful for such a trivial job.
For example, I could build my interrupt control logic with discrete ICs or with a single microcontroller. The discrete logic would be simple. Interrupts that were not serviced by the time the signal becomes inactive are lost. There would be no masking and the priorities would be fixed.
The microcontroller could easily do such things, like buffering and holding interrupts until they have been acknowledged and serviced, masking interrupts or assigning different priorities.
Which way would you prefer? An 'object oriented' microcontroller where I just look at the interface and don't care how it does its job internally? Or better the minimalistic approach with discrete logic where everything is 'global'? Still, preparing a tiny computer on a chip for such a simple job seems extremely wasteful...
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Definitely a microcontroller... The only downside of it can be the cost, but event there is no big difference... And of course there is the possibility of reprogramming the microcontroller with better code or even for an enterley different purpose...
"The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge". Stephen Hawking, 1942- 2018
|
|
|
|
|
Depends on the speed required: uControllers get more expensive at a faster rate as speeds rise that discrete logic does.
But generetrally, I'd go the programmable route, as it's a lot easier to add features or even make the main software easier and more efficient.
I had one board with three PIC devices and a Z180: one PIC for the head control (to offload the actual serial data timing), one to interface with the LCD (after we found that the Z180 was far, far too quick for the display to cope), and one to auto-range the PSU and provide a self destruct if the software was tampered with.
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I agree with OG, uControllers are easy to modify if requirements change and may have wasted functionality but at the prices WTH! Also better to have the extra functionality and not need it than to not have it and need it, should requirements change.
Everyone has a photographic memory; some just don't have film. Steven Wright
|
|
|
|
|
Micro Controller with as little glue logic as possible.
Gosh they're fun little things to code and play with.
|
|
|
|
|
It's like writing software -- implement a reasonable level of abstraction to plan for future requirements. So, microcontroller.
|
|
|
|
|
|
Microcontroller. PIC microcontroller. 32-Bit PIC Microcontroller. PIC32MM Microcontroller...
I suppose we, CodeProject folks, are just a little biased...
|
|
|
|
|
For me, the criterion would be can I possibly use the MC for anything else? If so then I would definitely go the MC route. If not then I would probably use the discrete logic. The exception would be if I really wanted another thing to program and I preferred that programming to wiring up a few more components. Only you can answer that.
|
|
|
|
|
|
The question isn't as philosophical. You named several practical aspects of the decision yourself and with practical aspects, it's not philisophical.
My personal choice would be an MCU. Nowadays, those things are cheap and you said yourself that this would be way more flexible. Plus, that's the way the big boys do it, less albeit more complex chip. On the other hand, if the setup is supposed to be (at least somewhat) educational, dicrete ICs are way superior as one can see what's connected to what (a shift register to a counter because of reason X) and an oscilloscope can be used to monitor the workings of the machine. With a programmed MCU, it's "signals go in, signals go out, here's the spec".
|
|
|
|
|
The problem solved by discrete logic, philosophically, is the successful amalgamation of various IO to one or more standard interface, to expand the capabilities of an existing system.
The problem solved by microcontrollers, again philosophically, is the successful amalgamation of various IO to create a standalone system.
So, it entirely depends on what you want.
If you want to use a set of radio's / sensors / mechanical parts as a standalone system, you should pick the microcontroller design.
if you want to use a set of radio's / sensors / mechanical parts as a single device in a larger overall scheme, you should pick the discrete logic design.
To be honest, I think most people default to microcontrollers, because they don't understand what they're doing.
Most IoT hardware I've seen, for example, combines microcontrollers and wireless chips.
Apart from the non-obvious stability issues arising from power-draw and overheating, it also introduces a huge attack surface for hackers and they are childishly easy to DDoS.
As a rule of thumb, I'd say:
- prototype it with microcontrollers if you want
- build it with discrete logic if you can
|
|
|
|
|
Well, there might be philosophical questions in using a Micro-controller for you project, the uController might be more powerful than the actual Computer, which to me seems wrong. However the glue logic can be a pain, would a PLC (Programmable Logic Controller) or a PLD (Programmable Logic Device) be an option these seem to have been overtaken by uControllers but would be more fitting as they are sudo hardware in my view. The main thing is the programming of the 'dang' things. Mind you to test the unit and hardware interface with a Nano...
modified 22-Jun-18 7:25am.
|
|
|
|
|
I looked at programmable logic before. There seem to be two ugly problems:
First, everything available is SMD and absolutely not fun to solder by hand.
Second, I found not a single suitable device that would work with 5V logic. The processor is a little older and could even work at 3.6 V, but only at a low clock speed. 5V tolerant inputs are the best you can hope for now. Any outputs would require awkward level shifting. Besides that, I want to keep the requirements to the power supply low. That oldschool CMOS needs only a single voltage and does not draw much of a current.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Quote: First, everything available is SMD and absolutely not fun to solder by hand. Too true, didn't think of that plus the programmers are costly. The glue logic is the correct way to go (mind you I would be tempted to use a uController for testing, just tried it for part of operation Cluster )
|
|
|
|
|
There is one task where I would prefer programmable logic. That would be for memory access and address decoding logic. If I don't want to be stuck with 64k memory, I will need something like a little MMU. Timing obviously is important here.
A fast microcontroller might also do the trick. It could buffer the selcted 64k segment internally and do all the CPU's memory requests from and to this buffer. When another memory segment is requested, it must copy thze buffer to the old segment in the RAM and reload the buffer with the content of the new segment.
The problem is to swap the buffer transparently so that the CPU never is halted or slowed down.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
The issue speed (I would have thought). You need it to be fast enough to switch in NOP operation so one way I could see of doing this is to hook up a flag to a memory address near the top of memory, if this Flag is set start the switching routine. Use a couple of NOPs to pad out and allow time to catch up, if you do this with glue logic you are tying your self to a maximum value, Programmable or uController give you the ability to expand if needed.
|
|
|
|
|
An ATTiny microcontroller chip can cost as low as $0.60 a piece, add some discretes to be able to handle any larger loads. Less work laying out circuits, and greater future flexibility than discretes alone.
just my 2 cents
|
|
|
|
|
Why buy a 7.1 instead of a 4.1 or 5.1 (if the price difference is bearable)?
Possibilities.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
You appear to have looked at the important, to you, objective differences and found them to be the same.
If you are certain that you looked at all of those then that only leaves subjective ones. Pick the one that you 'like'. Maybe because it is fun or seems 'better' without actually objectively qualifying that (although it might because you feel it is 'easier'.)
|
|
|
|
|
Is a prefab the early adoption of an upcoming fashion trend?
Sent from my Amstrad PC 1640
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
It's that time before one might be mistaken for one of the Beatles.
(That retort was really clothes to dull).
(I'm tired)
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
not what the folks(?) on Thunderbirds said/asked before they got instructions?
This internet thing is amazing! Letting people use it: worst idea ever!
|
|
|
|
|
Lennon et al before they met.
modified 21-Jun-18 16:21pm.
|
|
|
|
|
My machine (i7, 8GB Ram, SSD) began running slow a few minutes ago. I could hear the CPU fan running faster. something was going on, but I couldn't tell what. Checked running processes, nothing really eating up processor. Finally, after about 5 minutes this popped up:
https://i.stack.imgur.com/SCjNR.png^
Okay, so the Java Platform SE binary wants access through the firewall,right?
It's probably an update.
How would any non-tech user ever understand what to do in this case?
I barely know what this means and it all feels like nefarious activity.
These kind of error messages have to go away. All these advances in technology and yet we have error messages like this which require research to even understand how to deal with them.
All that work MS is doing on updates and stuff and they can't put one competent person in charge of error messages and making them understandable to users? Gaping hole!
Public v Private Networks
Also, look at that closely and you'll see that it looks like the thing already has access to public networks but now it wants access to private networks also, which seems very backwards and that whole explanation is confusing anyways. I'm sure few non-tech users even understand it.
Possible Solution
Instead of just ranting I'll offer a solution
1. Microsoft could hash the javaw.exe and whatever else is running
2. Let the user know that, yes, the exe is actually a confirmed version of the thing but we cannot guarantee it or what it does is safe, but it is likely safe.
3. Provide an interface for software which will be updating to provide a message or some kind of fingerprint that gives the user a higher level of confidence of what is going on.
It could be done.
|
|
|
|