go away spammer

Author Topic: MCU addiction?  (Read 1352 times)

0 Members and 1 Guest are viewing this topic.

Offline blackbeardTopic starter

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
MCU addiction?
« on: May 03, 2011, 07:56:36 AM »
Ok this is more of a debate rather then an actual electronics question. I often find myself looking at projects of amazing simplicity (i.e. adjustable timers, simple logic and even line followers) that rely on expensive MCU over analog circuitry or inexpensive digital circuits such as the ne555 or 74 series chips. i think maximizing your circuit without an mcu is a really good skill to learn since you can reduce the cost of a circuit from lets say $12 for a protoboard arduino setup (or other mcu) or even $35 for the cost of a full on arduino to mere pennies with the cost of 74 series shifters, multiplexers, logic gates and 555 timers if you're clever enough. plus you don't have to do any programming which in most cases means a more reliable circuit with few exceptions. essentially you'd only be limited by your soldering ability. now there are many things that mcu's can do much better and i'm not saying that mcu's are useless but i do find that allot of projects could be made simpler and cheeper when a little thought is put into the design. opinions?
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

Offline newInRobotics

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: MCU addiction?
« Reply #1 on: May 03, 2011, 08:50:05 AM »
MCU gives You more flexibility.

You could quite easily build $50 Robot using only analogue parts, however trying to upgrade already finished robot would be big hassle; for every single sensor or behavior you would like to add there would be a need to build separate module and at the end of the day You would have an very limited in ability and quite big in size MCU that was built from 'scratch'.

Moreover, debugging software is more time and money efficient than debugging hardware.

Plus, why reinvent the wheel? MCU offers everything what's needed  :)

Only excuse I find to go Your way is if person wants to learn how certain components work and how/where they can be used if for a certain project an MCU is an overshoot.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: MCU addiction?
« Reply #2 on: May 03, 2011, 10:01:01 AM »
I do use discrete logic at times instead of a processor.
One case is when the circuit MUST be working from the instance of power on and bad things can happen if the circuit is waiting for a process to configure its inputs and outputs.
Two cases are:
1- the fail-safe logic to a discrete H-bridge to prevent the 'smoke' state.
2- power on reset and sequencing circuits.

For other less critical jobs I'll use an 8pin PIC that only costs $0.80.

Offline richiereynolds

  • Full Member
  • ***
  • Posts: 112
  • Helpful? 3
Re: MCU addiction?
« Reply #3 on: May 03, 2011, 01:29:08 PM »
To the OP I'd have to say that a lot of people go for an MCU as programming is fun!

Offline mstacho

  • Supreme Robot
  • *****
  • Posts: 376
  • Helpful? 10
Re: MCU addiction?
« Reply #4 on: May 03, 2011, 01:31:15 PM »
For me, using the component chips is really useful if I'm doing something that an MCU would be impractical for.  For instance, although it's technically possible to read 16 tactile sensors from one (really big...) MCU, it's just easier to design a multiplexer circuit, maybe even with a timer circuit that addresses everything for me.  That way, when I'm reading the outputs of the sensors (yes, in an MCU), all of the hard stuff is done for me off the MCU, so I can be assured I won't run into programming errors.

But MCUs form so much of my work because...they're just easier to use :-P I'm WAY better at software than I am at hardware, and trying out a new idea in software is so much faster than doing it in hardware, so why would I bother to make a circuit if the MCU is capable of doing it in ten lines of code?

(Uh...haha the answer to that question is because the MCU is used as a blunt instrument to strike engineering over the head.  The specialized circuit is used to make the solution either more elegant, faster, less error prone, cheaper...)

I imagine the very same conversation took place decades ago when mechanical computers were being replaced with vacuum tubes and eventually transistors.  Why bother making a program to compute the square root, with $2 per second CPU time, when you can just make a cam that'll do it for you, much faster, and with higher precision?

MIKE
Current project: tactile sensing systems for multifingered robot hands

Offline vinniewryan

  • Full Member
  • ***
  • Posts: 56
  • Helpful? 2
Re: MCU addiction?
« Reply #5 on: May 03, 2011, 05:18:38 PM »
I think most engineers who do choose to use MCU's do so because of cost, time, and simplicity. For instance, if I want to build a simple circuit that flashes a pair of led's for 5 seconds when a light sensor triggers, I would have to build a multivibrator, timed transistor switch, and calibrate the sensor with resistors to my liking. This isn't all so hard, but when you're making PCB's and one little component is wrong, there are all kinds of problems that can arise (copper deteriorating during rework, over-heating cheap components, etc.). Alternatively, I can place a simple $0.80 cent MCU on the board, use the adc to calibrate the sensor via programming, make any changes needed without ruining the board or risking any un needed damage or mistakes, and the time to solder and program this, and design the PCB versus using discreet components is simply incomparable.

Further, for engineers with tons of fast paced or mobile projects it's much more cost effective and convenient to keep a few different MCU's in stock with minimal calibration components than a plethora of logic gates, timers... I work for a prototyping company so we're constantly making changes to how our circuits function, this would be merely impossible without MCU's and programming.

I do question why so many use Audrino boards when PIC's are so much cheaper ($35 VS $2). I design for cost, and in china it's the cost of a complete circuit board with soldered components versus a little black blob that does it all.

EDIT but to stay on topic, I agree completely. For a very basic circuit that has one simple function, MCU's just aren't needed. I think some people are just afraid of using components they're not familiar with (which is my ultimate passion).
« Last Edit: May 03, 2011, 05:22:26 PM by vinniewryan »

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: MCU addiction?
« Reply #6 on: May 03, 2011, 06:54:37 PM »
Hi,

I often find myself looking at projects of amazing simplicity (i.e. adjustable timers, simple logic and even line followers) that rely on expensive MCU
MCU's aren't expensive. They were back in the old times, but nowadays, a lot of power can be had for less than $4, as long as you don't need the exotic stuff.

Let's assume eg. a timer that must give a 15 minutes pulse each hour. It would be quite expensive and take up a lot of real estate in discrete logic and the precision will be all over the place if you try it with a 555 (which is actually more analog than digital). a $0.30 PIC processor can do it without working up a sweat.

Consider another timer function, to make a couple of pulses like: 10µs pulse, 10µs pause, 30 minutes pulse, 10µs pause, 10µs pulse, 10µs pause and finally a 50µs pulse.
Would you rather do that in discrete logic, than a cheap controller?


i think maximizing your circuit without an mcu is a really good skill to learn [...]
Analog and HF design is a better place to start, as this is the basis for all things digital.


since you can reduce the cost of a circuit from lets say $12 for a protoboard arduino setup (or other mcu) or even $35 for the cost of a full on arduino
Arduino is NOT a microcontroller, but a microcontroller board (the difference is quite large).
If your view of your world is to buy a fully populated gigantic board for each little app, then I can understand your wish to go discrete. I silently shake my head  each time I see a project involving eg. an Arduino to eg. control a timer or a remote among others, and sadly, the web is full of this kind of misuse and lack of understanding.


to mere pennies with the cost of 74 series shifters, multiplexers, logic gates and 555 timers if you're clever enough.
Since when did it take "clever" to use simple logic?

Clever... That's knowing when to go with an MCU, when to go with discrete logic and when analog is the better solution and knowing how to Mix 'n' Match.
It's not either/or and besides very small circuits, most (professional) apps will be a blend of technologies.


plus you don't have to do any programming which in most cases means a more reliable circuit with few exceptions.
With a whole lot of exceptions IMO. Lots of hobbyists care way too little for the basics - like a sound power supply (just read a bit here if in doubt) - as they "all" wanna start out with an android that can do their biddings, an autonomous spybot than does video recognition or similar advanced stuff - no wonder so many fail.
Get the basics down first, then build upon that (which goes for both learning in general and a physical robot).


essentially you'd only be limited by your soldering ability.
Oh, I could name lots of other limitations, like not having the above mentioned basics in order.
And using discrete logic has its own can of worms to negotiate - for starters, you need; proficiency in synchronous as well as asynchronous logic, know how to deal with eg. race hazard, know how to troubleshoot extra pulses appearing, and then we haven't even started on the PCB which can be a challenge when speeds go up, etc. etc.


now there are many things that mcu's can do much better and i'm not saying that mcu's are useless but i do find that allot of projects could be made simpler and cheeper when a little thought is put into the design. opinions?
Don't see it as either/or - there's a reason that you can get logic gates in singlets and I often make gates with diodes or transistors to avoid having a larger IC if I don't have single gates in stock and I often use a microcontroller for some logic app, as that is cheaper than using discrete logic or programmable logic (PAL, PEEL PLD etc.)
Controllers are cheaper than discrete logic, but you have to select the parts you need and not just use eg. an ATmega999999 for each little job.


As it goes... The guy that only have a hammer views every problem as a nail - get a full toolbox and rule the world (well a small part of it at least ;D)
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline TrickyNekro

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 1,208
  • Helpful? 15
  • Hardware and Firmware Designer
    • The Hellinic Robots Portal
Re: MCU addiction?
« Reply #7 on: May 04, 2011, 02:04:06 AM »
Or you can go CPLD, if you so like the gate arrangement... You can get good speeds too!

Or even embed a microcontroller in a FPGA! And then do the timer on it...  :-*

Generally, you would wish to go with the cheapest solution in production.

Discreet are nice when doing analog, cause you can always now what to expect (well... not the exact result, but at least a good approximation if you build and designed everything ok!)

Discreet can be very very powerful in analog applications. I've learned to love transistor totem polls instead of using for example MOSFET drivers.
But I'm not gonna build a PLL (Phase locked loop) circuit with discreet, I'm just gonna buy an IC to do the job.

Why? Not that I can't design it, but it's much easier to buy the IC, plus cost effective, as Soeren told you above.


Generally, don't depend on the Internet for nice solutions. Many many people out there don't know anything but to hit some lines on a compiler.
Buy some good books, read them and use everything to your own pleasure.

Books I recommend (it will take you time to read them and get what you really need):

http://www.amazon.com/Schaums-Outline-Electric-Circuits-Mahmood/dp/0071393072

And my bible... Sedra Smith, the Old Testament and the New Testament ( I mean that's a collection of two books )

These above can get you started like a pro warrantied! ;-)
For whom the interrupts toll...

Offline blackbeardTopic starter

  • Supreme Robot
  • *****
  • Posts: 575
  • Helpful? 4
Re: MCU addiction?
« Reply #8 on: May 04, 2011, 06:48:19 AM »
Hi,

MCU's aren't expensive. They were back in the old times, but nowadays, a lot of power can be had for less than $4, as long as you don't need the exotic stuff.

Let's assume eg. a timer that must give a 15 minutes pulse each hour. It would be quite expensive and take up a lot of real estate in discrete logic and the precision will be all over the place if you try it with a 555 (which is actually more analog than digital). a $0.30 PIC processor can do it without working up a sweat.

Consider another timer function, to make a couple of pulses like: 10µs pulse, 10µs pause, 30 minutes pulse, 10µs pause, 10µs pulse, 10µs pause and finally a 50µs pulse.
Would you rather do that in discrete logic, than a cheap controller?

Well a specific project i'm thinking of is one where an mcu was used to generate the frequency for a voltage multiplier. i wasn't talking about anything with a high degree of precision or complexity. i'm not saying that it's better to build an 8080 computer out of 74 series gates then to use a microcontroller (although it's allot more awesome and i hope to do that one day) but like every chip there's a time and a place when you should use an mcu over discrete logic or analog circuits. the $40 line follower is a good example to me of how you can use a simple analog circuit to do a simple task, all with less work then the $50 robot (and arguably more functionality from the get go given that it includes sensors and is fully autonomous)

Analog and HF design is a better place to start, as this is the basis for all things digital.

All of it's important. I know so many people who do reasonably complicated projects with microcontrolers but don't even know how a potentiometer works. of course anyone who goes to college will learn both analog and digital electronics but allot of self taught people tend to let the analog part slide, mainly because they don't have a good stock of parts (i.e. resistors of every value).




Arduino is NOT a microcontroller, but a microcontroller board (the difference is quite large).
If your view of your world is to buy a fully populated gigantic board for each little app, then I can understand your wish to go discrete. I silently shake my head  each time I see a project involving eg. an Arduino to eg. control a timer or a remote among others, and sadly, the web is full of this kind of misuse and lack of understanding.

YA YA I KNOW K LOLS

Ok i have enough knowledge to know the difference between the atmega168/328 and the arduino bootloader as well as the board that carries the atmega with the arduino bootloader. I say arduino because %75 of the projects that say they use an atmega328 only say that so people don't dismiss their project for containing an arduino but hey, if it walks like an ape and has the bootloader designed for the ape... well you get the idea. I'm not really refering to engineers since their formal education almost certainly includes both analog and digital electronics and maximization is probably a fundamental. The hobbyist on the other hand probably uses either a basic stamp 2 or an arduino but might also have learned that they can take the chip off the board and integrate it in their project which is why i said $10-$30. an engineer will probably custom print a board and use the full extent of his knowlege to make it as cost and time effective as possible while selecting from millions of parts. a hobbyist on the other hand will probably have to order or scrounge parts for each project and since something like an arduino can do a multitude of things they may not be exposed to much cheaper solutions that although not as versatile, can greatly improve their project's quality.

Since when did it take "clever" to use simple logic?

Clever... That's knowing when to go with an MCU, when to go with discrete logic and when analog is the better solution and knowing how to Mix 'n' Match.
It's not either/or and besides very small circuits, most (professional) apps will be a blend of technologies.

Ok think of it this way. You can get a BASIC or C++ programming environment for free and so it's a very popular place to start for many hobbyists. As such when they get bored of making Zork like text based games or dice rollers for GURPS they will likely discover microcontrolers realizing that they can use the skills they learned making useless buggy programs to do cool stuff like turn servos or make horrible sounding home made instruments. If you've had no prior experience with electronics then analog electronics and discreet digital logic can be intimidating. now look at the arduino. you plug it into your computer and you can almost immediately start doing SOMETHING with very little thought put into it. If they had the knowlege to "Mix 'n' Match." as you put it then they could do allot more with allot less time and a bit of forethought.

With a whole lot of exceptions IMO. Lots of hobbyists care way too little for the basics - like a sound power supply (just read a bit here if in doubt) - as they "all" wanna start out with an android that can do their biddings, an autonomous spybot than does video recognition or similar advanced stuff - no wonder so many fail.
Get the basics down first, then build upon that (which goes for both learning in general and a physical robot).

OK you got me on that. All i can say is that the $40 robot is an example where a completely analog circuit does something much more usefull out of the box then the $50 robot does i.e. use sensors. if you throw a the same line sensor on the $50 robot then it can probably run circles around the $40 robot but that would make it arround $60 + programming time which for me makes the $40 robot the winner.


Oh, I could name lots of other limitations, like not having the above mentioned basics in order.
And using discrete logic has its own can of worms to negotiate - for starters, you need; proficiency in synchronous as well as asynchronous logic, know how to deal with eg. race hazard, know how to troubleshoot extra pulses appearing, and then we haven't even started on the PCB which can be a challenge when speeds go up, etc. etc.

ok you got me there again. I am more leaning towards simple circuits but that's all still valid.


Don't see it as either/or - there's a reason that you can get logic gates in singlets and I often make gates with diodes or transistors to avoid having a larger IC if I don't have single gates in stock and I often use a microcontroller for some logic app, as that is cheaper than using discrete logic or programmable logic (PAL, PEEL PLD etc.)
Controllers are cheaper than discrete logic, but you have to select the parts you need and not just use eg. an ATmega999999 for each little job.


As it goes... The guy that only have a hammer views every problem as a nail - get a full toolbox and rule the world (well a small part of it at least ;D)


agreed :P
"sure, you can test your combat robot on kittens... But all your going to do is make kitten juice"

First step: Build androids with AI
Next step: Give them vaginas

 


Get Your Ad Here

data_list