avr or pic? - Page 1
Forum section: electronics / general

author: SixD
author_rank: Contributor
timestamp: December 16, 2013, 06:42:04 pm
content: I am working on a multimeter and wounder what I should use avr or pic?

author: mariush
author_rank: Super Contributor
timestamp: December 16, 2013, 06:56:36 pm
content: Whatever platform you have a programmer for.If you don't have a programmer, buy an arduino which has a built in bootloader and you can just upload the code through usb.If you don't get bored with it and abandon the project half way, then when you're done you can spend money on an actual avr programer and make your own board and all that.Alternatively, get a pickit 3 and some pic16f chips and a breadboard and do it.It doesn't matter which one - avr or pic - for such a project.

author: fcb
author_rank: Super Contributor
timestamp: December 16, 2013, 07:35:00 pm
content: PIC of course."Multimeter and wounder"...

author: Rigby
author_rank: Super Contributor
timestamp: December 16, 2013, 07:48:13 pm
content: I don't know if you did any research on this before you asked here, but the reason you won't find consistent answers to this question on Google is that there is no consistent answer - it's situation & preference dependent.So, pick whichever one you want. Flip a coin. Pick the easier part number to pronounce -- or the harder. Pick the cheaper part, or the more expensive.In short: it doesn't matter.If you're trying to start a flame war, knock it off.

author: tszaboo
author_rank: Super Contributor
timestamp: December 16, 2013, 08:37:39 pm
content: MSP430 because battery life. Or Cortex M3 to calculate RMS digitally. Or STM8 because that is cheap. Or NEC custom made IC for it. Or the Rabbit 8 core, because it has a funny name. Why do you limit yourself?

author: nctnico
author_rank: Super Contributor
timestamp: December 16, 2013, 09:07:35 pm
content: MSP430 is a sensible choice. It is ultra-low power and there are versions which can drive an LCD display directly.

author: casper.bang
author_rank: Frequent Contributor
timestamp: December 16, 2013, 09:22:02 pm
content: Quote from: nctnico on December 16, 2013, 09:07:35 pmAre they lower power than AVR's ATtiny A (Pico power) chips? I'm in awe at seeing them sleep at 90nA and yeah, I chose AVR over PIC after some bad experiences with the PIC programming model (bank selection, few registers etc.).

author: mrflibble
author_rank: Super Contributor
timestamp: December 16, 2013, 09:22:42 pm
content: +1 for msp430 for low power if this thing is going to be battery powered. STM32 for number crunching. And everything in between 100% depending on your project requirements and your personal preferences.Choice of mcu is going to be the least of your worries for a multimeter. Well okay, maybe not least, but certainly not the #1 issue. So just flip a coin, ignore coin flip result and just pick something you like.

author: Corporate666
author_rank: Unknown
timestamp: December 16, 2013, 09:24:34 pm
content: Quote from: NANDBlog on December 16, 2013, 08:37:39 pmGreat answer!I don't understand why everyone thinks there is only Atmel and Microchip?Atmel and Microchip aren't even the biggest microcontroller companies, not by far! It is like saying "I am having a party and need the best beer.... is it Heineken or Stella Artois?"

author: owl_uk
author_rank: Contributor
timestamp: December 16, 2013, 09:27:29 pm
content: They are all much of a muchness. I'd say pick one you can find easy help for on google, which brings you back to PICs and AVRs. MCUs can be good fun but they can also be a real pain in the arse. You'll need some help. What the micro can actually do isn't as important a factor as it might seem at first.

author: nctnico
author_rank: Super Contributor
timestamp: December 16, 2013, 09:41:14 pm
content: Quote from: casper.bang on December 16, 2013, 09:22:02 pmAfter being bitten I don't trust anything Atmel writes in their datasheets. They grossly exaggerate the specs so I don't use their chips at all. Too much risk. Anyway the sleep current isn't that interesting. The wake-up time and the power consumption while running are far more important for a low power application.

author: adam1213
author_rank: Regular Contributor
timestamp: December 16, 2013, 10:29:57 pm
content: Quote from: SixD on December 15, 2013, 06:21:13 pmIf you plan to make something that is Arduino based then may as well use an Arduino compatible board to start with.Quote from: SixD on December 15, 2013, 06:19:14 pmWhy do you want to do an Arduino based project? If you plan to do an Arduino based project why are you using a pic18f4550 with Arduino like software that is not 100% compatible with Arduino?Quote from: SixD on December 16, 2013, 07:03:54 pmAs has been suggested by others in this thread the choice of micrcontroller is influenced by desired battery life.I think your aims are too ambitious for what I perceive to be your experience level. Start with making a simple multimeter. Once that works start working on improving it.

author: popamp
author_rank: Newbie
timestamp: December 16, 2013, 10:41:43 pm
content: why do i hear dave's voice in my head talking about "atmel fan boys" ?

author: AlfBaz
author_rank: Super Contributor
timestamp: December 17, 2013, 02:12:46 am
content: Quote from: SixD on December 16, 2013, 06:42:04 pmMaybe you should start with one of these

author: dannyf
author_rank: Super Contributor
timestamp: December 17, 2013, 02:23:54 am
content: QuoteEven that may be too challenging for the OP. I would recommend starting with blinking an led.

author: Monkeh
author_rank: Super Contributor
timestamp: December 17, 2013, 02:46:10 am
content: Quote from: dannyf on December 17, 2013, 02:23:54 amWITHOUT using Arduino.

author: Stonent
author_rank: Super Contributor
timestamp: December 17, 2013, 02:57:45 am
content: Quote from: Monkeh on December 17, 2013, 02:46:10 amhttp://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_34690_-1

author: TheMask
author_rank: Newbie
timestamp: December 17, 2013, 03:13:23 am
content: It doesnt matter which AVR or PIC.Use the one that you already have, or the one that you can obtain most easily, just to get you started.Later, try to experiment with both and avoid the 'AVR-vs-PIC' nonsense

author: oPossum
author_rank: Super Contributor
timestamp: December 17, 2013, 03:35:19 am
content: Quote from: Monkeh on December 17, 2013, 02:46:10 amCode:#include <msp430.h>main() { BCSCTL1 = 0; P1OUT ^= P1DIR = BIT0; }Use what Fluke  uses.... MSP430.Get the F5529 launchpad - it is the newest and best yet.The front end and ADC design will be more difficult than the firmware.

author: calexanian
author_rank: Super Contributor
timestamp: December 17, 2013, 05:10:13 am
content: Well of course you use the more expensive one silly! O0

author: Psi
author_rank: Super Contributor
timestamp: December 17, 2013, 05:15:26 am
content: Write some code on a PIC to make it upload your code onto an AVR

author: poorchava
author_rank: Super Contributor
timestamp: December 17, 2013, 07:10:53 am
content: On topic:pick whatever floats your boat.You want board portfolio? Microchip wins.You want affordable development tools? Microchip wins.You want good silicon? Atmel wins.You want good feature set at low price point? Atmel wins (Attiny13 and the like)You want 16 or 32 bit architecture? Microchip winsYou want DSP? Microchip winsYou want low power? Microchip winsYou want good chip architecture? Atmel winsYou want good community support? They both have it.You want a beginner-friendly MCU? Atmel wins (just make sure you have a fuse-bit doctor thingie ready).You want simple assembly? Atmel winsYou want free tools and compiler that are actually usable? Atmel wins.You want a broad portfolio of peripheral modules (eg. encoder inputs, sdio, hardware parallel port)? Microchip winsYou want to make a single sided board at home? Microchip wins (peripheral pin select in present in some dspics and pic24 rocks)You are designing a product that will have a long lifetime? Microchip wins.You want something that will give you a job later? ARM wins. Fatality!

author: Jeroen3
author_rank: Super Contributor
timestamp: December 23, 2013, 09:29:07 pm
content: You can turn your multimeter into a multiscope when using a NXP LPC4370...

author: codeboy2k
author_rank: Super Contributor
timestamp: December 24, 2013, 11:44:03 am
content: I've always like the MSP430 for anything battery operated.But I'd like to try the Energy Micro chips and see how the two compare.(Note: Silicon Labs recently bought Energy Micro)

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: December 24, 2013, 12:22:52 pm
content: Quote from: poorchava on December 17, 2013, 07:10:53 amMicrochip's free 16/32 bit compilers are fineQuote..and high-end parts in DIPYou want to put something into production? Microchip wins due to very low-cost programming service fro MicrochipDirect.

author: NiHaoMike
author_rank: Super Contributor
timestamp: December 25, 2013, 04:07:02 am
content: Quote from: NANDBlog on December 16, 2013, 08:37:39 pmYou don't need that much processing power to do it in a multimeter application. An 8 bit microcontroller can easily do it. A DSP makes more sense in a scope.

author: JTR
author_rank: Regular Contributor
timestamp: December 25, 2013, 10:19:05 am
content: Quote from: poorchava on December 17, 2013, 07:10:53 amI would have thought you nailed it pretty good, that is until you mentioned the PIC24. That really becomes a gun at a knife fight. Otherwise if doing an apples to apples comparison and staying with 8-bitters, yeah, I think you got it pretty damn straight.

author: Udayan Sinha
author_rank: Regular Contributor
timestamp: December 27, 2013, 04:03:42 am
content: Just like Dave said in his video "it doesn't matter"Just pick any one which you like and get going with it. Later on you can experiment with both & see which one suits you the most & avoid emotional attachment to any one line of MCUs(if you want to go pro).

author: zapta
author_rank: Super Contributor
timestamp: December 29, 2013, 04:10:43 pm
content: Quote from: SixD on December 16, 2013, 06:42:04 pmI presume that you are an hobbyists, no experience in microcontrollers, little experience with electronics and is building a fun one-off project with flexible requirements.One good choice is to get a small Arduino board that can connect to a computer (e.g.https://www.sparkfun.com/products/11098), program it using the Arduino software (free, many tutorials and examples) and then use the Arduino board as a component in your project. The arduino has a built in analog to digital converter that will give you basic multimeter accuracy. For display you can use the Arduino serial monitor or you can add a LCD display that interfaces nicely with Arduino (you can fine many, as well as sample code).As you gain more experience you can explore other microcontrollers, build the circuit from scratch, use programmers, etc.

author: tszaboo
author_rank: Super Contributor
timestamp: December 30, 2013, 11:28:06 am
content: Quote from: NiHaoMike on December 25, 2013, 04:07:02 amIt really depends on your speed requirement. If you want to process 100Khz Ac signals (1MSPS) digitally at 16 bit, that is not going to work with an 8 bit, unless you compromise somewhere.

author: JoeN
author_rank: Frequent Contributor
timestamp: December 31, 2013, 09:11:40 am
content: My suggestion: Whoever gives you the best and largest quantity of free samples, of course. For me the clear winner has been Freescale (3x5 instead of 3x2 for Atmel and Microchip).

author: Psi
author_rank: Super Contributor
timestamp: December 31, 2013, 10:35:14 am
content: heh, not the free sample thing again

author: Jon86
author_rank: Frequent Contributor
timestamp: December 31, 2013, 11:40:32 am
content: Quote from: zapta on December 29, 2013, 04:10:43 pmI definitely second this, if you've not got much experience with micros then this is going to make your life a hell of a lot easier.No need to buy any software or a programmer, and no need to spend ages choosing which exact chip to go with.You can add any peripherals you want, too. Like the LTC2400 24bit ADC to give you as much resolution as you'll ever need. It's difficult to get lost with Arduino, everything's so well documented. If you don't want to go with Arduino, there's an Arduino-like IDE for the MSP430 microcontrollers too

author: poorchava
author_rank: Super Contributor
timestamp: January 02, 2014, 12:00:26 am
content: Freescale charges a hangling fee of (if my memory serves me right) $10. At least they do when ordering from Poland. Microchip doesn;t ask stupid questions, and that's the whole reason why I've been using their stuff for some time. I went with Microchip when Atmel was in trouble and the price of simple ATMega8 went from 1€ to 3€ or more and Microchip was giving stuff away for free. On the bright side I don't feel bad because I've designed PICs into a commercial product or two, so their expenses for providing samples have been covered.Anyway - Cortex M0 controllers cost almost the same amount of money as 8-bit AVRs and PICs... I think that ARM won the war between AVR and PIC

author: kebogen
author_rank: Contributor
timestamp: January 02, 2014, 03:33:36 am
content: QuoteIt looks great

author: Frant
author_rank: Regular Contributor
timestamp: January 02, 2014, 12:43:25 pm
content: I think there is more to it than just the microcontroller core architecture, price, brand and someone's personal preference about it. First, one has to carefully consider the motivation for designing a multimeter, keeping in mind that there is a number of established manufacturers with millions invested in R&D and more than enough products to saturate the multimeter market. Unless there is some new concept or a speciffic "niche" application, I think it is pointless.Anyway, one approach that seems logical to me is to find a modern microcontroller which incorporates the most of the needed functionality in its integrated peripherals. Of course, in order to do that, the project requirements must be known. I would start from the ADuCM360. It is a low power ARM Cortex-M3 microcontroller with two high performance 24-bit ADCs. An intelligent graphic display with optional LED backlight may be a good idea.

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 02, 2014, 02:36:55 pm
content: Quote from: NANDBlog on December 30, 2013, 11:28:06 amYou could capture a burst of data for processing and/or use randomized equivalent time sampling. The display only has to be updated at a rate of 4Hz or less (10Hz at reduced precision for a bar graph) so there's a lot of cycles available to you.

author: Unknown
author_rank: Unknown
timestamp: January 02, 2014, 03:28:52 pm
content: 3 pages, blimey. For a subject that doesn't need any discussion.

author: Monkeh
author_rank: Super Contributor
timestamp: January 02, 2014, 03:30:10 pm
content: Quote from: Lurch on January 02, 2014, 03:28:52 pmIndeed, the answer is obviously MSP430.

author: Unknown
author_rank: Unknown
timestamp: January 02, 2014, 03:35:34 pm
content: Quote from: Monkeh on January 02, 2014, 03:30:10 pmI'm not biting.

author: Monkeh
author_rank: Super Contributor
timestamp: January 02, 2014, 04:05:26 pm
content: Quote from: Lurch on January 02, 2014, 03:35:34 pm

author: TheGreatGooglyMoogly
author_rank: Contributor
timestamp: January 04, 2014, 12:28:44 am
content: Does no one love the Zilog Z80? Or at least its microcontroller varients the Z8Encore! chips?Hmm I said that as a joke, but it turns out the product line is quite strong:http://www.zilog.com/index.php?option=com_product&task=product&businessLine=1&id=2&parent_id=2&Itemid=56So let me ask a new flame question, what brand of ADC to use in the multimeter? O0

author: codeboy2k
author_rank: Super Contributor
timestamp: January 04, 2014, 09:25:25 am
content: I'm an old Intel/Zilog hack from back in the day when the 8080 and Z80 dominated the world. I've used their Z8Encore MCU. I first tried it out back in 2004 or 2005 I think.. It's ok, a bog standard embedded controller, it has the basic peripherals. It's not too pricey, 8Mhz/20Mhz,built in OSC, WDT, OCD,8k flash+10bitADC+16bit timer can be had for about $1.50 to $2.00 . I liked it when I used it. They had a basic C compiler back then and it worked. I haven't look at the product line again since then, so your post made me look.I'd probably use it again if it fit the need; I think it can be a good choice for where someone might choose to put a PIC, because their product line has a several offerings in small 8,16,20 pin DIP, SO and QFN packages. They seem to have a lot of specialized application specific controllers too, based around their core z8 and z16 and ez80 lines.Often a choice of which MCU to use is driven by immediate availability, continued availability, the quality of the toolchain, and customer service/support. I don't know where Zilog stands these days on those fronts, but I'll take the time to consider them again. Also, lots of the "popular" MCUs have a strong online community, but I've not seen that with Zilog parts.

author: casper.bang
author_rank: Frequent Contributor
timestamp: January 04, 2014, 06:17:19 pm
content: Quote from: Lurch on January 02, 2014, 03:28:52 pmAre just how do you contribute value to the subject? Crikey, just ignore if you already think you know the answer.

author: Unknown
author_rank: Unknown
timestamp: January 04, 2014, 06:41:41 pm
content: Quote from: casper.bang on January 04, 2014, 06:17:19 pmIt was humorous. As I've mentioned before, this seems to be a pointless exercise on an international forum.

author: codeboy2k
author_rank: Super Contributor
timestamp: January 05, 2014, 04:19:16 am
content: I don't think it's pointless to discuss the pros and cons of various available embedded MCUs... This is what gives the design engineer a better understanding of whats available, when it might be good to select one chip over the other, and provides a background to assist in choosing the right chip for the job.The "pointlessness" comes from those (generally, not specifically meaning you, Lurch) who try to force "the one true chip" onto every project, theirs and others'. There is no "one true chip", and every project needs to be evaluated with an open mind regarding which chip best fits the job to be done.The original question "which is better, avr or pic?" is indeed pointless, but leads to discussion (sometimes quite heated!) about various available chips and technologies.However, I do agree that this topic comes up alot, and has been discussed substantially on this forum already and many other forums on the web.