PIC vs Arduino

sirch2

Joined Jan 21, 2013
1,037
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 !
Dan
Atmel chips (e.g. the ATmega 328) are also around a few dollars. Remember that Arduino is a platform not a chip. You can quickly prototype on the Arduino, no programmer needed, and then burn you finished project to an Atmel chip using the Arduino as a programmer.
 

THE_RB

Joined Feb 11, 2008
5,438
Arduinos have become so "kiddie school" that these days I'm not sure I could take a designer seriously if he used Atmel micros.

Pros use PICs. ;)
 

lippy

Joined Jul 17, 2012
4
Arduinos have become so "kiddie school" that these days I'm not sure I could take a designer seriously if he used Atmel micros.

Pros use PICs. ;)
I understand what your saying re: 'kiddie school', but to dismiss anything made with an AVR micro just because of the platform is overly harsh to say the least.

Sure, there are probably thousands of Arduinos out there that have been used for little more than to flash an LED, but that doesn't mean that the AVR chips, on their own or used in the Arduino platform, can't be used to accomplish some pretty impressive feats. If their simplicity helps open the door of micros to people who might otherwise have been too intimidated, that's all the better.

I worked with PIC's long before I'd ever heard of Arduino, but after I was given an Arduino a few months back I've really started to appreciate the power that comes out of that approach. I haven't given up on PIC's by any stretch, but I now have another tool set that has some serious advantages.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hey, I've had a try at programming the Arduino Uno (compatible) using online reference codes, reference material and code with the software - lot of fun!

I've since created the typical "blinking light", PWM circuit, a debounce push button circuit and a few more. Next I progressed to a count down 7 segment led displays. I converted this to count up. Took a bit of reading manuals (count++ rather than --count stumped me for a while), but in the end I worked it out from literature in manuals.

I then created code to run two 7 segment led displays to count down - in long code. I then used an array to tighten the code up - bit confusing, but "just" makes sense. I changed this code yesterday to count up. Next is to introduce the debounce button to count up with each press.

My next step will be to multiplex the 2 digits. However, here's my question (can't find it easily on the internet):

If I multiplex 2 digits, does than mean the digits will be 1/2 the intensity? I know that the continuous forward current is around 30mA (and 20mA is probably better), but do you pump this guy up to it's peak (max 100mA) as it's not on continuously? Could I instead aim to run it at 40mA instead of 20mA to compensate?
 

MrChips

Joined Oct 2, 2009
30,706
If you keep the current limiting circuitry the same, yes, the intensity will be reduced but not necessarily by 50%. The current-to-light output is not linear and then the perception of light intensity is grossly non-linear, more like a logarithmic function.

You don't need to pump up the current. It just depends on how bright you consider satisfactory. I can run a 20mA LED at 1mA and still get satisfactory results.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
You don't need to pump up the current. It just depends on how bright you consider satisfactory. I can run a 20mA LED at 1mA and still get satisfactory results.
The LEDs will be used in digit displays outdoors and via PWM code and an LDR so that their brightness will adjust to suit daylight / night. I'd just like to be able to achieve typical 20mA brightness down to fairly dim.

Yes, that's right about logrithmic - I remember seeing the graphs. So I just did a search on LED intensity vs current (see link below). It does seem that in order to achieve a brightness of 1 (full) it requires 20mA, hence if the multiplexing of 2 digits is 50% each, then according to the graph I need to have the current peak to 40mA (see below). Have I got that correct?

 

Attachments

bance

Joined Aug 11, 2012
315
I think that what MrChips is saying is that perception is more important than the actual performance. The human brain has a mechanism that makes assumptions based on the information fed to it, this is a hangover from ancient times. It's also why multiplexing works, although the multiplexed leds are consuming less power and are therefore technically "dimmer" they don't necessarily appear dimmer!

Try it without changing the power first and see if it's bright enough, it's trivial to change the values of resistors....

HTH Steve.
 

sirch2

Joined Jan 21, 2013
1,037
Arduinos have become so "kiddie school" that these days I'm not sure I could take a designer seriously if he used Atmel micros.

Pros use PICs. ;)
Like lippy I was using Pics (since somehting like the mid 90's) but had a go with Arduinos a few years ago because of the excellent libraries and have never looked back.

The "if it ain't hard, it ain't professional" argument is one I have encountered my entire working life - Mainframes vs Unix Boxes and Vaxes vs PCs, DOS vs Windows, C++ vs Java. It's always been around.

Me, I'm too lazy to be bothered; it's more fun to learn the new thing than stick to something just because it is hard or obscure...
 

tshuck

Joined Oct 18, 2012
3,534
Me, I'm too lazy to be bothered[...]
I believe that is part of the exact sentiment that makes the Arduino not professional, and part of the reason that so many people choose to use it.

The "if it ain't hard, it ain't professional" argument is one I have encountered my entire working life - Mainframes vs Unix Boxes and Vaxes vs PCs, DOS vs Windows, C++ vs Java. It's always been around.
...and there are applications and arguments for each choice. An engineer needs to be able to weigh the options and select what would get the job done and stay within budget. Knowing the options gives the engineer the power to make an informed decision.
 

sirch2

Joined Jan 21, 2013
1,037
I use the term "too lazy" in the sense of Heinlein's Man who was too lazy to fail. You could make your own foil capacitors, carbon resistors and op-amps but I bet you don't, life is to short/I'm to lazy. (BTW I have made plenty of things from scratch, from variable capacitors to cheese but in general, having grasped the basics I buy readymade where I can).

The conclusion I draw from those "hard" vs "easy" analogies is that easy generally wins over the long term. However we have to consider the term "easy" carefully - what I suppose I really mean is, as Newton said, "standing on the shoulders of giants".

If someone has already spent time developing and debugging an LCD Library or a I2C Library or whatever, why would I want to repeat that exercise, especially if a community has tested and debugged it?

Working with Arduino in no way requires less engineering skill than working with any other Microcontroller, all the same constraints, memory, power, speed, electrical characteristics are still there.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
I had a maths teacher back in high school, who always said to us, "when you do something, do it the quickest, easiest way you know how". I agree with that principle.

I am relatively new to electronics and have had no formal training to date. My first objective was to try and learn basics - what does a capacitor do, resistor, transistor, etc. I too did try build thinks such as a battery (potato and copper disks). It was both fun and interesting. Some basics up front I think to a degree are essential but only to a limit to start with. Enjoyment causes interest which causes learning.

Having said that, with the plethora of knowlege available to us at hand now days via the internet, I question to what degree this foundation is required.

We now have young kids picking up on technology and "creating" at an early age with limited knowledge. Though this is sometimes frowned upon by th learned, this generation has tools available to them that were not available years ago. They build on our forefathers knowledge and push ahead to the next level.

As an example, we now have "TechShop" in America, which gives the public access to machinery for construction that is usually only available to large companies or schools. This accessibility allows the public to do short training stints on a machine (need to know basis). From this, ideas by the "non engineers" are giving rise to "inventions" and "designs" from lay people not specialised in that field, but who are coming up with solutions to designs. It's not only engineers and trained designers who come up with great design solutions. Lay people do as well, except they usually don't have the platform to proceed.

I think electronics can be the same (to a degree). I learnt Fortran some 25 years ago at Uni as part of a course - it was with "card readers"! What a nightmare! Arduino and the readily available code however has sparked my interest and made programming both fun and possible with limited knowledge. I'm able to build the end result without having to understand exactly how the chip works. Having fiddled now with code, it has sparked interest which in turn has made me read literature on things such as array, hex, binary, etc. It's a reverse way of learning but I think more enjoyable as I tend to learn now because I want to and at my own pace.

I teach computer drafting to interior design students at a Uni and tend to follow the same principle. I teach the student 3D modelling of buildings the easiest method first. They get hooked as they find it fun, quick and easy. I then trickle feed them further detail (higher learning) in a sequence that I believe they need in order to progress. They come out learning heaps more than if I go through the basics up front thoroughly as I used to.

A discussion I've had at school now is, to what degree do students need a thorough foundation? In the past we relied heavily on memory learning. We had no option. There was no iPhone nor Google. In my opinion there is quite alot of knowledge that simply doesn't need to be memorized as given it's really used, it can be called up at will on the spot. Effort and memory instead can be on information that we need to process more frequently.

I think one main focus now should be on "investigation" and "problem solving". "How do I find that out? Where do I find that information? How do I collate it to achieve my end goal with the resources I have available to me?

Just my some of my thoughts...
(PS. I will try to building 2 circuits - one with PWM setup and one without and check out the "percieved differents" - better than graphs!).
 

bance

Joined Aug 11, 2012
315
If people only utilise a chip and make it work without understanding how it works, who will design the next. better more capable chip?

Regards Steve
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
If people only utilise a chip and make it work without understanding how it works, who will design the next. better more capable chip?

Regards Steve
Absolutely agree. There are those who will study chips in detail and therefore come up with newer better chips. But I wonder whether more is achieved by working together (with people of all different strengths) rather than everyone spending time to understand the finite detail.
 

sirch2

Joined Jan 21, 2013
1,037
I quite agree, chrischrischris, it's only by experimenting first that people get interested in how it works and then how it is designed. Insisting that you are not allowed to use something before you know how to design it is a great way to put people off.

The first electronics I did was to build a crystal radio, I was aged 9 or 10. There is no way I could have understood the maths and theory behind it, but it got me hooked. If you had sat me down in a class and given me several years of theory first I would have given up.
 

tshuck

Joined Oct 18, 2012
3,534
No one is disagreeing that the Arduino can be a good platform to learn on, or even experiment with.

The Arduino, however, is limited in its ability to do things and should not be used in most professional designs.

Due to the abstraction of the microcontroller, people are not required to understand much about them and how they work. Most users do not understand the limitations of the platform (that's the point, anyway), and see it as the end-all, be-all solution, thinking they understand how microcontrollers work, and can only design for that platform, limiting their ability to approach a problem with a new solution.
 
Last edited:

sirch2

Joined Jan 21, 2013
1,037
I really have no axe to grind, like I said I have used PICs but I now use Atmels (with the arduino boot loader) but I'd be interested to know in what way Arduino is "limited in its ability"? Consider also that there is optiboot to overcome some of the Arduino start-up issues...
 

ErnieM

Joined Apr 24, 2011
8,377
If people only utilise a chip and make it work without understanding how it works, who will design the next. better more capable chip?
Rubbish.

If someone truly understands the how, they ain't working on the user level:

they are in there designing the next generation of chips.
 

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
I suppose I'm using my Arduino at the moment for some limited functions, so I can really say much here now. The only thing I can say however, is I'm having heaps of fun. I've written my first code for counting from 00 to 99, advancing the number with a pushbutton, stopping switch bounce and resetting the count with a second button. I'll be using this on my scoreboard down the track.

Can someone have a quick look at it and tell me if it's ok (note I'm a beginner! :rolleyes:). I'll attach it below. For future, is it better to add the text here or in the ino file? (I could only add it as a txt file)..

Also, does "allaboutcircuits" have a site where I can start to upload these files for others to use?
View attachment _12_2013_09_01_two_seven_seg_plus_switch_counter.txt
 
Last edited:

ErnieM

Joined Apr 24, 2011
8,377
Chris: perhaps you should start your own thread/topic for your question.

Beginners gotta start somewhere, that's the whole point of platforms like the Arduino.
 
Top