1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Which Microcontroller you suggest me for my needs?

Discussion in 'Microcontrollers' started by elisaios, Nov 7, 2012.

  1. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    That is good. Keep away from the arduino IDE (Integrated Development Environment). It is horrible and you won't learn anything if you use it.
     
  2. edeca

    edeca Active Member

    Joined:
    Apr 8, 2008
    Messages:
    589
    Likes:
    38
    Location:
    England
    I did not mention PIC in my post. It would be nice if we could keep this civil, rather than attacking eachother. Personally I think that comparing any two particular microcontrollers is like comparing bananas and space shuttles.

    And some take 3 (e.g. JMP), 4 (e.g. RET) or 5.

    It depends on the length of the program counter and whether you are accessing external memory (I was actually surprised at the latter one). For example see CALL on pg. 47 of the PDF below. For devices with a 16 bit program counter the CALL will take 4 cycles, for 22 bit it will take 5. So it will depend whether you have a device with a max of 128KB program memory (with the 16 bit counter) or 8MB (with 22 bit).

    Then look at CPSE on pg. 64. The instruction takes a different amount of time (from 1 to 3 cycles) depending what you are skipping, or whether the condition is matched. This makes perfect sense really as the chip has to "read ahead" without actually executing.

    Then there is the reduced 8 bit tinyAVR core which has a smaller instruction set - many instructions take less cycles on this.

    Note that all of the above is for 8 bit AVR cores only, a good reference is here: http://www.electro-tech-online.com/custompdfs/2012/11/doc0856.pdf
     
    • Like Like x 1
  3. RichTheDude

    RichTheDude Active Member

    Joined:
    Jun 8, 2010
    Messages:
    304
    Likes:
    53
    Location:
    UK
    You mentioned that a PIC requires 4 clock cycles for every instruction (a fallacy based on old 16 and 18F parts) then mention that AVR's can do SOME instructions in one clock cycle, then go onto say everyone wants to get the work done at the lowest possible clock frequency and hence lowest power consumption.

    Slight problem here, you have completely negated the fact that MODERN PIC's have a significant power advantage over AVR's. Your reasoning is a perfect example of the isolated points fallacy.

    A more sensible review on the differences is here http://www.electricstuff.co.uk/picvsavr.html

    I suggest most people read it, and this gentlemen also comes to the conclusion that the comparison is pointless, both have advantages and disadvantages. I just hate erroneous information being spread about.

    I do agree with MisterT on one thing though, elissaios13. It would be wise to stay away from the Arduino IDE.
     
    Last edited: Nov 11, 2012
    • Like Like x 3
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Hayato

    Hayato Member

    Joined:
    Jun 21, 2006
    Messages:
    694
    Likes:
    14
    Location:
    BR

    being a PIC, ARM, 8051 and AVR user, i have just one thing to say (agreeing with 3v0, edeca and RichTheDude), about those type of discussion:
    lol
     
    • Like Like x 1
  6. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
  7. atferrari

    atferrari Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    2,812
    Likes:
    121
    Location:
    Buenos Aires - Argentina
    :confused:

    edeca, in what sense? Could you please elaborate?
     
  8. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,804
    Likes:
    135
    Location:
    morristown,tn
    You cant compare them to compare anything you have to have two of the same things like this

    AVR has to have the same stuft as the PIC like this.
    You could then compare that
    Say you have a 32inch tv and you friend has one two you could compare some of the parts but say yours is a Plasma TV And his is a LCD there no way to compare that. And his may sound better look better made better but
    it's not apples to apples one has a better picture and the rest is junk. Don't work

    But after all this talk here we all all need to get Microchip on the band wagon They need to give us C for free
    not a 1000 lines or 60days and you need two pic two hold the code now gunk.

    Then we have something to compare.
     
    Last edited: Nov 11, 2012
  9. DerStrom8

    DerStrom8 Super Moderator Most Helpful Member

    Joined:
    Aug 9, 2010
    Messages:
    5,484
    Likes:
    503
    Location:
    Vermont (GMT-5:00)
    He means that Pics and AVRs, for example, are completely different things, and can't be compared. Basically "comparing them is like comparing apples and oranges", except a little more extreme :p
     
  10. Hayato

    Hayato Member

    Joined:
    Jun 21, 2006
    Messages:
    694
    Likes:
    14
    Location:
    BR
    Ferrari,

    Each one has its purpose.
    A banana is a banana and fits its purpose.
    A space shuttle is a space shuttle and fits its purpose.

    Samething with uCs, each one fits its purpose. If my project requires a PIC, then I'll pick a PIC, if it requires an ARM, then I'm gonna pick an ARM.
     
    • Like Like x 1
  11. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,253
    Likes:
    961
    Location:
    Loveland, CO USA
    And on another forum they are arguing (Ford or GMC) (Farrari or Lotus). What uC is best is like what transportation is best. I have a tractor, really good for pulling trees out of the ground. I have a TRUCK, it holds a house of furniture. Neither is good for long trips. A subway is best! No subways here. Jeeps are good in the mountains.

    There are uCs that I like, because I know them and uCs that I don't like because I don't know them.
    There are no clear winners or every one would use it.
    There are no clear loosers because they go away.
    Every week something new comes out and changes the battle. PIC is no longer a 4mhz part.

    A slow part in the hands of a skilled programer will beat a really fast part in the hands of a freshmen. Wrong tool used well or right tool not used well.

    The MSP430 is a 16 bit part playing in a 8 bit market. It adds 8bits + 8 bits about as fast as any 8 bit uC. It adds 16 + 16 much faster than a 8 bit part. It can't do 32 bit math like a ARM.

    Today I am looking for a small foot print part with a fast ADC and large RAM. The CPU speed is not important. A good timer is important. Each of us has different requirements and tastes.

    I like apply pie more than bananas. At breakfast I like bananas better. I might like a space shuttle. How do they taste?
     
  12. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    Comparing AVR and PIC is more like comparing apples and oranges. It does not matter which one you eat, but if you are allergic to oranges, don't blame the orange.
     
    Last edited: Nov 13, 2012
    • Like Like x 1
  13. be80be

    be80be Well-Known Member

    Joined:
    Aug 23, 2008
    Messages:
    4,804
    Likes:
    135
    Location:
    morristown,tn
    misterT there no winner here If it works use it. AVR looks good use it PIC looks good use it

    They all have there Pluses But there is no clear better chip. And this is not helping the OP

    And as it goes I like any chip that fits the job at hand with out adding un needed parts.

    Tell the OP how to find a good kit he said a friend was using a ATmega328 help the Man get started
     
    Last edited: Nov 13, 2012
  14. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    Last edited: Nov 13, 2012
  15. RichTheDude

    RichTheDude Active Member

    Joined:
    Jun 8, 2010
    Messages:
    304
    Likes:
    53
    Location:
    UK
    Classing a particular microcontroller as an "allergen" is a mentality I will never understand. If it gets the job done to specification, who cares? My hackspace friends voice similar views and I will never understand it...

    @OP: Out of the three people I know that use AVR's (myself included - I own a USB tiny), one of my other friends uses a AVR Dragon to do On Chip Debugging. I have no idea if this is the latest or greatest out there for AVR's but it would be worth checking out :).

    You could get an ATMEGA328 and run it on a breadboard, in fact I did this when developing my first AVR project in a prototype form (coming from an MSP430 and PIC background). Wiring up to a ISP (in system/circuit programming) programmer is fairly easy:
    http://d32zx1or0t1x0y.cloudfront.net/2009/07/atmega8_breadboard_11_lrg.jpg and there is avr studio or winavr.

    http://www.atmel.com/microsite/atmel_studio6/
    http://winavr.sourceforge.net/

    I use winavr. It has been great for my needs, but I have no idea if proper on chip debugging is possible - I have no hardware to do so, so its a moot point anyway.

    You can easily make a TTL to UART converter with a MAX232 IC ( http://www.winpicprog.co.uk/pic_tutorial_rs232_board.htm ), Nigel's tutorial page has some great hardware examples.

    Could be a cheaper (and more fun in my opinion) way of learning how to use uCs, and hopefully a bit of computer architecture. Hope that helps :)
     
  16. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    That page is ~5 years old and many things listed there are incorrect today.

    Did you read the link you posted.. talk about isolated points.

    I agree with the conclusion he makes. And I think all we can really compare are the "isolated points", because there is no application or project. There isn't any requirements mentioned for the microcontroller we are "choosing". So all we can do is to compare some small details like ADC conversion speed, power consumption etc. because it is easy to say "faster ADC is better" and "smaller power consumption is better".
     
    Last edited: Nov 13, 2012
  17. DerStrom8

    DerStrom8 Super Moderator Most Helpful Member

    Joined:
    Aug 9, 2010
    Messages:
    5,484
    Likes:
    503
    Location:
    Vermont (GMT-5:00)
    I think that was a very clever metaphor. What he meant was simply if someone doesn't know how to use a microcontroller, or if it doesn't work for them the way they want it to, they shouldn't blame it on the device.
     
    • Like Like x 1
  18. RichTheDude

    RichTheDude Active Member

    Joined:
    Jun 8, 2010
    Messages:
    304
    Likes:
    53
    Location:
    UK
    Finally something we agree on MisterT, it is still the most sensible review I have seen about the AVR vs PIC debate. Most are completely blinded by one or the other - this is electronics not religion... Typically the ardent followers I have met have never tried another uC toolchain.

    I keep thinking of my friends at hackspace, they do class PIC's as an allergen but have never used one! Mention you have used something else other than arduino/AVR, and they make the sound a dodgy workmen does when it comes discussing the price (breathing through teeth) :p.
     
  19. elissaios13

    elissaios13 New Member

    Joined:
    Nov 8, 2012
    Messages:
    6
    Likes:
    0
    Thanks for the answers.
    Guys i dont care if pic is better that avr or the opposite.I think that because many people use each one,both will worth.Indepedantly my choice is to start with an avr because i there is a guy who can help me.

    Now i am thinking of buying an avr dragon or 3-4 uC with bootloader so i dont need avr dragon.
    I want to ask:
    1)I havnt exactly understand what is in circuit debugging that avr dragon offers.Is it important for a begginer? or with just a bootloarder with be ok and after 2-5 months or more maybe i will need a programmer/debugger?
     
    Last edited: Nov 13, 2012
  20. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland
    Well, I have used PICs, but not recently. And I do follow what new devices Atmel comes up with, but I don't know much about the latest Microchip products. Like I don't know if any PIC has a floating point unit or DMA in their controllers.
     
    Last edited: Nov 13, 2012
  21. 3v0

    3v0 Coop Build Coordinator Forum Supporter

    Joined:
    Jul 14, 2006
    Messages:
    9,404
    Likes:
    227
    Location:
    OKLAHOMA USA
    I could not agree more.
    I am not up to speed on the dragon but I expect it functions much like the pickit3 regarding debug. They do what is called ICD or In Circuit Debugging. ICD is nice because you can debug your code in real time without editing the code to add debug statements .With the ICD the variable values can be seen in 'watch' windows. The limitation is that you have to stop the code with a breakpoint to allow the debugger to update the values. That is to say the do not update during the run.

    If you go with a boot loader you can debug your code on a simulator in a way that is similar to ICD. Or you can add printf to a serial port which allows you to see what the code is doing using a serial terminal emulator on the PC.. Both of these are more painful then ICD but there are people who still prefer to use them.

    Tools like the dragon and pickit3 are excellent buys when you consider what they do.
     

Share This Page