PIC vs Arduino

Georacer

Joined Nov 25, 2009
5,182
I would like to add that you shouldn't use the Arduino platform if you want your MCU to handle timings smaller than the crude level of 1ms. The current models (maybe DUE is different, but I haven't used it) can't really handle processes with very fine time resolution.

This is due to the high level of programming, which given the 5MHz clock can't use the hardware effectively enough.
 

Markd77

Joined Sep 7, 2009
2,806
Sorry, it was not very clear. You could have two 7-segments lit at a time, so the first pair would have their common pins connected together, then 14 wires for the segments of that pair of 7-segments. Those 14 wires would then connect to the next pair, etc.
Because you have 15 7-segments you need 8 connections to the pairs of common pins (one is just on its own).
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
317
Georacer - the problem with less than 1ms with Arduino - good to know. You mentioned however a clock speed of 5Mhz. The unit I'm looking at is 16Mhz. Does that change anything?

Markd77 - yes, that makes sense now. Hence the need for only updating half the speed - good idea.

Bance, multiplexing the buttons - I'd have to get my head around this one. I'll be controlling the signals via a 12 button remote. This drives 12V NO or NC relays. These would in turn be inputs into the uC driving the digit display. So don't think multiplexing here would work for me.
 

Potato Pudding

Joined Jun 11, 2010
688
The Uno only has 16 digital IOs (of which 6 can be PWM outputs) and 6 analogue inputs. The Mega has 54 (14) and 16 respetively.
I think the UNO is a better choice if you are really starting out. Add to your shopping list 2 to 10 blank ATMega168P and ATMega328P chips to go with it and make programming them with the Arduino bootloader one of your priority projects. Keeping spare chips and the fact that the UNO's MCU is socketed can be handy if you tried something that you have just learned was a bad idea like trying to drive a relay coil directly from the MCU pin.

The fact that the UNO only has 22 IO is not a big deal if you can plug in a couple more chips to a breadboard. With two more MCUs you have 60 IO even after using a few pins for communication between them.

Being able to pull out a programmed chip from the UNO and solder it into a prototype board for a permanent project is useful, and no problem as long as you have those spare bootloader chips to swap back into the UNO board.

The SMD MCU is less tinker friendly. Leonardo and the other SMD MCU Arduino's are a time saver for an experienced coder and builder with big projects. You will need to be ready to shop out or to etch and mask your own circuit boards if you want to make a permanent copy of any projects with a clean chip. That is all something for more technically advanced skills.

UNO projects translate easily with a $2.50 proto board.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
317
Mr potato, your absolutely right. I was debating with myself the Uno vs Mega as I could see the Uno had a replacable chip whereas the Mega didn't. Yes, I could blow it up and then were will I be. I'll see if I can change the order as I placed it on the weekend and they won't act on it until Monday. Thanks for the advice
 

Potato Pudding

Joined Jun 11, 2010
688
I would like to add that you shouldn't use the Arduino platform if you want your MCU to handle timings smaller than the crude level of 1ms. The current models (maybe DUE is different, but I haven't used it) can't really handle processes with very fine time resolution.

This is due to the high level of programming, which given the 5MHz clock can't use the hardware effectively enough.
You can revert to cycle loops. You need to be careful because I am not certain at what point the optimizer will reduce out "wasted" cycles.

Delays of less than a millisecond are possible, but not with the Delay routine (which should be avoided anyways), or with the Timer routines.
Find ways to keep the chip busy for a while.
 

Potato Pudding

Joined Jun 11, 2010
688
Mr potato, your absolutely right. I was debating with myself the Uno vs Mega as I could see the Uno had a replacable chip whereas the Mega didn't. Yes, I could blow it up and then were will I be. I'll see if I can change the order as I placed it on the weekend and they won't act on it until Monday. Thanks for the advice
From most of what I have seen, the death of the whole chip is much less likely than losing a single pin. With all those pins to spare, the Mega would still be nearly as good even after one or two dead pins.

UNO or Mega; you will still be able to learn more than imagined you could.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
317
From most of what I have seen, the death of the whole chip is much less likely than losing a single pin. With all those pins to spare, the Mega would still be nearly as good even after one or two dead pins.
Good point. It would only be a problem I suppose if I somehow overcooked the chip and it somehow shorted the Vcc pin (assuming there is one).
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
317
The OP question was PIC vs Arduino, so of course it implies use of the Arduino bootloader
I ended up getting the Arduino equivalent. I've since programmed a flashing LED, a stable switch (eliminating "bounce"), a dimming led, a PWM circuit based on mapping the resistance from an LDR - all lots of fun. So much fun and so little time to do it in...
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
317
Great! Why don't you present each exercise as an AAC blog?
I'd be happy to, however I'm not sure how to create a blog in here. Also, what I ended up doing is start to watch a series of youtube videos by Jeremy Blog - their excellent:http://m.youtube.com/watch?v=fCxzA9_kg6s&desktop_uri=%2Fwatch%3Fv%3DfCxzA9_kg6s

Just a next question if I can.

1. I am starting to understand programming in Arduino language. Is this infact C++? If so, can this language then be converted so I can write to a PIC?

2. An Arduino Mega cost around $20AU, so relatively cheap. It can deal with quite a few inputs outputs and PWM. Given the language is kinda easier, is there any reason I wouldn't simply use this board (with expander boards if required) and abandon the whole PIC idea? Can it simply do all the driving (via ULN 2003's to drive my 24V leds digits)?
 

bance

Joined Aug 11, 2012
315
Of course you can use an avr (ATMEL) they're basically the same as pic's. It's just a matter of preference, if you start out on a PIC you're used to the programming language, so you would choose a PIC,and vice versa. The only difference is that Pic's tend to be a little more sophisticated, they offer a little more bang for the buck. That's the reason you should try to get to grips with micro-conrtrollers as a genre, learn all of them, and use the one that's most applicable to your application.

HTH Steve
 

Shagas

Joined May 13, 2013
804
The only difference is that Pic's tend to be a little more sophisticated.
Really? I thought the AVR was abit more sophisticated from the point of architecture but abit more expensive from what I read (I'm a beginner in microcontrollers)
 

bance

Joined Aug 11, 2012
315
Shagas you're correct, I probably over stated, the point I was trying to make was that in general PICs tend to have more features at a given cost base, which is one of the reasons they are so popular. And also that it's a good idea to be open minded about which part to choose for a given use case, rather than becoming a "fanboy".

Regards Steve.
 

Georacer

Joined Nov 25, 2009
5,182
I'd be happy to, however I'm not sure how to create a blog in here.
On the top blue ribbon over each page, the second link reads "Blogs". Drop the list and click "Your Blog". You can start a new entry there. New blogs don't appear in any subforum, but you can let us know about it in a new thread.

1. I am starting to understand programming in Arduino language. Is this infact C++? If so, can this language then be converted so I can write to a PIC?
Most serious libraries for the Arduino are written in C++. However, I 'm not sure if the main program can be written in C++. The main problem with firmware portability, however, is the different hardware available between the chips.

An Arduino Mega cost around $20AU, so relatively cheap. It can deal with quite a few inputs outputs and PWM. Given the language is kinda easier, is there any reason I wouldn't simply use this board (with expander boards if required) and abandon the whole PIC idea? Can it simply do all the driving (via ULN 2003's to drive my 24V leds digits)?
Sure, the arduino is great for prototyping.
But $20AU and the related hardware can be heavy on cost and size for some people and applications. There might be a need to miniaturize the setup. But usually you do that by building your own board around an atmega, and keeping the same firmware, instead of going into a PIC.
 

MrChips

Joined Oct 2, 2009
35,127
The price you pay for a chip does not reflect the prowess of the design and engineering team but the shrewdness of the finance, marketing and sales team and distribution and sales outlets.
 

Alan brad

Joined Aug 29, 2013
9
For these work PIC program is best one.we can easily use PIC "C" program we can able to control timer operation , temperature , clock ,,...every thing is possible for PIC controller.
 

techristian

Joined Aug 27, 2013
53
I have an Arduino here. My friend suggested that I buy it over 2 years ago. I haven't done anything with it yet.

Then a year ago, I was browsing around an old electronics store and bumped into an old serial Velleman programmer. It was way overpriced at $100 and I knew nothing about PIC at the time so I bought it. It would only handle a few chips.

I finally met someone locally who was heavy into PIC development and steered me to the PICKIT3. NOW I'M STARTING TO UNDERSTAND IT.

I never bothered to develop with the Arduino because I'm looking at a mass produced end product for under $100. A $30-$40 Arduino can't be a part of that. It is too expensive. But a $2 or $3 PIC chip can ! Besides that...MICROCHIP is giving me free samples to aid me in the prototyping process. I also heard a rumor that Pickit4 will program Amtel as well......and the high end 32 bit PICs are actually MIPS processors. So there you have it. My input after 6 months with the PIC.

Dan
 
Top