Author Topic: Micro-controller or not?  (Read 16767 times)

0 Members and 2 Guests are viewing this topic.

Offline electron_misfireTopic starter

  • Contributor
  • Posts: 32
  • Country: au
Micro-controller or not?
« on: May 27, 2014, 10:49:43 am »
Hi all,
So I'm designing a Quiz-o-matic machine from an idea in a book. The original design used a micro-controller for the main processing but I feel I can accomplish the task with just some basic logic  :-+.
The book was aimed at beginners, so i can understand why the author would use a simple micro-controller solution.
So my question is, should I just use an arduino as the main processor or challenge myself by designing some digital circuits.
As you can tell i'm not the most advanced in electronics but i'm not a beginner either.
Thanks in advance, Emil
 

Offline Dago

  • Frequent Contributor
  • **
  • Posts: 659
  • Country: fi
    • Electronics blog about whatever I happen to build!
Re: Micro-controller or not?
« Reply #1 on: May 27, 2014, 11:03:24 am »
If you want to learn something that is useful in the future as well I suggest you use a microcontroller.

Discrete logic is very rarely used anymore. Some individual chips here and there but large systems pretty much never. It is of course a good idea to understand how it works but I still think learning to use a microcontroller is much much more useful skill.
Come and check my projects at http://www.dgkelectronics.com ! I also tweet as https://twitter.com/DGKelectronics
 

Offline electron_misfireTopic starter

  • Contributor
  • Posts: 32
  • Country: au
Re: Micro-controller or not?
« Reply #2 on: May 27, 2014, 11:31:10 am »
I agree, I was already leaning that way.
Laying out a PCB with that many components would be TOO challenging for me right now.
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2100
  • Country: sk
Re: Micro-controller or not?
« Reply #3 on: May 27, 2014, 11:39:23 am »
I do love discrete logic, probably i'm one of the last guys here who's buying the 74xx parts :D but on the other hand i'm using the atmegas everywhere, if the awfull slowness is not an issue, then arduino. if speed is a concern - then throwing the arduino libraries and loader away and AVR GCC is your friend ;) the chineese arduino clones are pretty cheap - you can get a arduino nano clone for under 12-15$ from DX. if you erase the bootloader, then you end up with a nice breakout board with atmega328, crystal, LDO and FT232 USB-serial.. and the whole thing fits into a DIP socket ;) (i'm using DIP40 sockets cut down to 30 pins).
 

Offline electron_misfireTopic starter

  • Contributor
  • Posts: 32
  • Country: au
Re: Micro-controller or not?
« Reply #4 on: May 27, 2014, 12:00:55 pm »
I think I'll just use a cheap arduino clone like rob said since i'm not trying to get extremely accurate timing.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6736
  • Country: nl
Re: Micro-controller or not?
« Reply #5 on: May 27, 2014, 02:01:23 pm »
what is a
Quote
Quiz-o-matic machine
?
That should first be the topic then when everybody understands what it means and what it does we can discuss what the optimal solution is. But as I read above you already made up your mind so good luck.
 

Offline geekbot

  • Contributor
  • Posts: 21
  • Country: in
Re: Micro-controller or not?
« Reply #6 on: May 28, 2014, 07:41:49 am »
You should do it using digital logic! Micro can reduce the no of parts but there is no fun in that!
 

Online tszaboo

  • Super Contributor
  • ***
  • Posts: 9844
  • Country: nl
  • Current job: ATEX product design
Re: Micro-controller or not?
« Reply #7 on: May 28, 2014, 07:49:14 am »
If you want to learn something that is useful in the future as well I suggest you use a microcontroller.
Huge disagreement. If you do something simple with an Arduino, you made something every idiot can do (count to one). DIf you do the same thing with logic IC than you actually accomplish something unique. Not to mention, this saves you a lot of time and effort later, as when the PCB is done, you are done with the design part.
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2100
  • Country: sk
Re: Micro-controller or not?
« Reply #8 on: May 28, 2014, 10:41:25 pm »
If you want to learn something that is useful in the future as well I suggest you use a microcontroller.
Huge disagreement. If you do something simple with an Arduino, you made something every idiot can do (count to one). DIf you do the same thing with logic IC than you actually accomplish something unique. Not to mention, this saves you a lot of time and effort later, as when the PCB is done, you are done with the design part.

huge disagreement as well... once you done it with arduino, you can move a giant leap forward by discarding the arduino libraries, erase the bootloader from the atmega and code the whole thing in C - that's a lot of learning and lot of  fun ;)
as i mentioned earlier i love discrete logic, but let's face the reality.... MCUs, CPLDs and FPGAs are the way to go.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Micro-controller or not?
« Reply #9 on: May 28, 2014, 10:50:39 pm »
Quote
discarding the arduino libraries, erase the bootloader from the atmega and code the whole thing in C - that's a lot of learning and lot of  fun ;)

You don't need to do any of that: simply write your code in C or C++ (and you can even do that in the arduino ide) and upload it to your arduino. The execution is identical to if it had been uploaded to an avr.

================================
https://dannyelectronics.wordpress.com/
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2100
  • Country: sk
Re: Micro-controller or not?
« Reply #10 on: May 28, 2014, 11:19:44 pm »
Quote
discarding the arduino libraries, erase the bootloader from the atmega and code the whole thing in C - that's a lot of learning and lot of  fun ;)

You don't need to do any of that: simply write your code in C or C++ (and you can even do that in the arduino ide) and upload it to your arduino. The execution is identical to if it had been uploaded to an avr.

i lknow that very well ;) by erasing the loader you get 2k more flash for your code (on some boards even 4k). and who the hell would you that arduino "something" (sorry it's not an IDE)  for C coding ? :D any IDE + AVR GCC  + avrdude  is far better. that arduino "something" is excellent for newbies making their  first  steps with MCUs, but unusable for serious work.

just to make it clear.. i'm not dehonesting the arduino software.. those guys behind arduino did an excellent job. they made the MCU world accessible to almost everyone.  i'm just mentioning that sooner or later almost everyone will find it rather limiting than helpful for more complex projects.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Micro-controller or not?
« Reply #11 on: May 28, 2014, 11:47:57 pm »
Quote
any IDE + AVR GCC  + avrdude  is far better.

Depending on how you define "better".

Quote
that arduino "something" is excellent for newbies making their  first  steps with MCUs, but unusable for serious work.

Bad carpenters blame their tools.
================================
https://dannyelectronics.wordpress.com/
 

Offline nitro2k01

  • Frequent Contributor
  • **
  • Posts: 846
  • Country: se
Re: Micro-controller or not?
« Reply #12 on: May 28, 2014, 11:54:41 pm »
by erasing the loader you get 2k more flash for your code (on some boards even 4k). and who the hell would you that arduino "something" (sorry it's not an IDE)  for C coding ? :D any IDE + AVR GCC  + avrdude  is far better. that arduino "something" is excellent for newbies making their  first  steps with MCUs, but unusable for serious work.
Actually, newer boards are using the Optiboot bootloader which is only 512 bytes by default, and you can upgrade also older chips to use Optiboot as well. You can use the bootloader with avrdude as well. Using a bootloader has the added benefit of giving 3 more IO pins available, (which coincides with hardware SPI) assuming you have something plugged in there that could misbehave from the programming of the chip.
Whoa! How the hell did Dave know that Bob is my uncle? Amazing!
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: my
  • reassessing directives...
Re: Micro-controller or not?
« Reply #13 on: May 29, 2014, 03:34:07 pm »
Bad carpenters blame their tools.
sometime its reasonable to blame on the tools. bad carpenters dont know how to pick proper tools to get the job done. most importantly, dont know how to get the job done.

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Micro-controller or not?
« Reply #14 on: May 29, 2014, 03:44:51 pm »
Bad carpenters blame their tools.
sometime its reasonable to blame on the tools. bad carpenters dont know how to pick proper tools to get the job done. most importantly, dont know how to get the job done.

 Your analogy is too simplistic and general to be useful in this discussion. The Arduino IDE is certainly not a professional IDE with all the tools/debuggers/simulator that the Pros have available, but that doesn't mean that same pro programmer couldn't complete the same tasks and projects and finished code using the arduino IDE. If you can give a specific example of where a programmer using the arduino IDE cannot accomplish a given task in the finished product/code that some other IDE can, then I'm all ears.

 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2100
  • Country: sk
Re: Micro-controller or not?
« Reply #15 on: May 29, 2014, 05:09:34 pm »
Bad carpenters blame their tools.
sometime its reasonable to blame on the tools. bad carpenters dont know how to pick proper tools to get the job done. most importantly, dont know how to get the job done.

 Your analogy is too simplistic and general to be useful in this discussion. The Arduino IDE is certainly not a professional IDE with all the tools/debuggers/simulator that the Pros have available, but that doesn't mean that same pro programmer couldn't complete the same tasks and projects and finished code using the arduino IDE. If you can give a specific example of where a programmer using the arduino IDE cannot accomplish a given task in the finished product/code that some other IDE can, then I'm all ears.

just one example: multiple source files for a project. and we don't even have to continue ;) because a convenient work with multiple files is a MUST for an IDE.  i was trying arduino 1.0.5 for linux and there is no obvious way how to handle multiple files (never tried the windows version)... and i need to mention that i was working with AVR before arduino existed (mainly AT90S8515 - coding in assembly) so i'm not a newbie.
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Micro-controller or not?
« Reply #16 on: May 29, 2014, 05:23:39 pm »
Bad carpenters blame their tools.
sometime its reasonable to blame on the tools. bad carpenters dont know how to pick proper tools to get the job done. most importantly, dont know how to get the job done.

 Your analogy is too simplistic and general to be useful in this discussion. The Arduino IDE is certainly not a professional IDE with all the tools/debuggers/simulator that the Pros have available, but that doesn't mean that same pro programmer couldn't complete the same tasks and projects and finished code using the arduino IDE. If you can give a specific example of where a programmer using the arduino IDE cannot accomplish a given task in the finished product/code that some other IDE can, then I'm all ears.

just one example: multiple source files for a project. and we don't even have to continue ;) because a convenient work with multiple files is a MUST for an IDE.  i was trying arduino 1.0.5 for linux and there is no obvious way how to handle multiple files (never tried the windows version)... and i need to mention that i was working with AVR before arduino existed (mainly AT90S8515 - coding in assembly) so i'm not a newbie.

 The Arduino IDE editor does have 'tabs' that allow pasting other code into separate edit windows that all get compiled with the main 'sketch'. Again not the ease that professional IDEs offer but the basic mechanism for combining seperate source code is there, as well as the standard C/C++ include function to add H and CC files.

 Never said you were a newbie, just questioned your statement that the Arduino IDE somehow limits what an experienced programmer can accomplish with it.

 
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: my
  • reassessing directives...
Re: Micro-controller or not?
« Reply #17 on: May 29, 2014, 05:50:31 pm »
Bad carpenters blame their tools.
sometime its reasonable to blame on the tools. bad carpenters dont know how to pick proper tools to get the job done. most importantly, dont know how to get the job done.
Your analogy is too simplistic and general to be useful in this discussion. The Arduino IDE is certainly not a professional IDE with all the tools/debuggers/simulator that the Pros have available, but that doesn't mean that same pro programmer couldn't complete the same tasks and projects and finished code using the arduino IDE. If you can give a specific example of where a programmer using the arduino IDE cannot accomplish a given task in the finished product/code that some other IDE can, then I'm all ears.
did i say Arduino IDE is to be blamed? no. did i relate my simplistic generalization specific to arduino? no. but you are right, its too general to be any near specific to this discussion. but since you are all ears... here, i cant make an atmel mcu that lies on the arduino board (tiny, mega or whatever) to make a single pulse at its running clock speed. if i want a custom signal running at the clock speed, arduino IDE is not the right tool. but for my newly bought 3d printer kit that need to be calibrated that based on oshw sanguino duino this and that, arduino ide can get the job done quickly and nothing else. my quote about "can blame on the tool" is more specific to when like... you bought a hammer and hit the nail and the hammer breaks into pieces, then you should blame on the tool (or maybe yourself for not buying a decent quality hammer).

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: my
  • reassessing directives...
Re: Micro-controller or not?
« Reply #18 on: May 29, 2014, 05:54:03 pm »
and another thing.... debugging and compiling a "Decent complexity" of software in arduino is not a fun thing to do. with only few lines of code arduino can take minutes to complete compilation, unless you havent experience a compiler that can do the job in several seconds for hundreds of thousands of lines of code. the only thing that makes arduino alives is i believe because of the community built on it or practical oshw diy devices emerged based on it, and most importantly as someone said, it is the bridge between muggles and witches. imho...
« Last Edit: May 29, 2014, 06:12:30 pm by Mechatrommer »
 

Offline retrolefty

  • Super Contributor
  • ***
  • Posts: 1648
  • Country: us
  • measurement changes behavior
Re: Micro-controller or not?
« Reply #19 on: May 29, 2014, 06:11:25 pm »
Bad carpenters blame their tools.
sometime its reasonable to blame on the tools. bad carpenters dont know how to pick proper tools to get the job done. most importantly, dont know how to get the job done.
Your analogy is too simplistic and general to be useful in this discussion. The Arduino IDE is certainly not a professional IDE with all the tools/debuggers/simulator that the Pros have available, but that doesn't mean that same pro programmer couldn't complete the same tasks and projects and finished code using the arduino IDE. If you can give a specific example of where a programmer using the arduino IDE cannot accomplish a given task in the finished product/code that some other IDE can, then I'm all ears.
did i say Arduino IDE is to be blamed? no. did i relate my simplistic generalization specific to arduino? no. but you are right, its too general to be any near specific to this discussion. but since you are all ears... here, i cant make an atmel mcu that lies on the arduino board (tiny, mega or whatever) to make a single pulse at its running clock speed. if i want a custom signal running at the clock speed, arduino IDE is not the right tool. but for my newly bought 3d printer kit that need to be calibrated that based on oshw sanguino duino this and that, arduino ide can get the job done quickly and nothing else. my quote about "can blame on the tool" is more specific to when like... you bought a hammer and hit the nail and the hammer breaks into pieces, then you should blame on the tool (or maybe yourself for not buying a decent quality hammer).

 i think you are referring to the arduino pin functions digitalRead() and digitalWrite() which are quite slow as they allow the pin number to be variable and agnostic to the actual port/bit of interest which allows portability across the several different AVR chips the IDE supports. However you are not limited to having to use those functions and can directly access the port/pins registers using your own functions at machine clock speed. The arduino IDE does not fundamentally limit the speed of which the compiled code runs at, that is limited by only the clock speed and the avr-gcc optimizing compiler, and of course the skill and experience of the programmer.

What else ya got?
« Last Edit: May 29, 2014, 06:15:05 pm by retrolefty »
 

Offline nitro2k01

  • Frequent Contributor
  • **
  • Posts: 846
  • Country: se
Re: Micro-controller or not?
« Reply #20 on: May 30, 2014, 06:36:16 am »
The Arduino IDE is just using a C(++?) compiler behind the scenes in that sense, if you stay away from the Arduino libraries, it's "just" gcc with a rather buggy editor. But the real problem is that it invites the novice programmer to use the slow library functions. In other words, it prioritizes ease of access over teaching good code practices. I've seen people who were never told you can do
Code: [Select]
PORTD = 0xFF; do silly things like
Code: [Select]
for(int i=0; i<8; i++){
    digitalWrite(i, HIGH);
}
and then complaining that their program is slow.   :palm:

I'm calling this a failure on the part of Arduino as a learning tool.
« Last Edit: May 30, 2014, 06:37:55 am by nitro2k01 »
Whoa! How the hell did Dave know that Bob is my uncle? Amazing!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Micro-controller or not?
« Reply #21 on: May 30, 2014, 10:25:47 am »
Quote
just one example: multiple source files for a project.

"Tab"? it is well known and well documented, btw.

Quote
I've seen people who were never told

If we had to be told to learn, we would still be living in caves.
================================
https://dannyelectronics.wordpress.com/
 

Offline rob77

  • Super Contributor
  • ***
  • Posts: 2100
  • Country: sk
Re: Micro-controller or not?
« Reply #22 on: May 30, 2014, 10:57:03 am »
Quote
just one example: multiple source files for a project.

"Tab"? it is well known and well documented, btw.


you mean to create new tabs and copy paste the code over from your other files ? (e.g. to reuse code from your other projects) 
yeah ! that sounds like ultra super convenient work with multiple files  :-DD and that little app is the best IDE ever and everyone should use it ! 

btw.. that arduino app is excellent for small single file easy projects - no doubts. those guys behind the arduino did an excellent job (i mean overall - considering the boards, libraries and the software as a whole), they made the AVR MCU available to virtually anyone.

but seriously.... it's not an IDE suitable for complex projects (in other words.. it's not an IDE ). if you still think it's an IDE then go ahead and use it for complex projects... i'll rather save some time using something else ;)
btw... i'm using either eclipse, or my small & fast setup of  Vim + bunch of extensions/scripts + make (depends on which of my computers i'm using)

 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Micro-controller or not?
« Reply #23 on: May 30, 2014, 12:40:32 pm »
Quote
that sounds like ultra super convenient work with multiple files

I believe the discussion is about if it is an IDE, not if it is an ultra super convenient IDE.

Quote
but seriously.... it's not an IDE suitable for complex projects (in other words.. it's not an IDE ).

Well, if you define IDE that way, nothing can be an IDE.
================================
https://dannyelectronics.wordpress.com/
 

Offline nitro2k01

  • Frequent Contributor
  • **
  • Posts: 846
  • Country: se
Re: Micro-controller or not?
« Reply #24 on: May 30, 2014, 01:59:43 pm »
If we had to be told to learn, we would still be living in caves.
So you principally see no value in good education because everyone is supposed to go out and learn on their own anyway?
Whoa! How the hell did Dave know that Bob is my uncle? Amazing!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->