PICing it or How I learned to love Microcontrollers

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

PICing it or How I learned to love Microcontrollers

Post by philba » Sat Jan 22, 2005 1:05 pm

<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by Enzo:

...
One of my personal beefs is the "use a PIC for it" response to requests for logic circuits. No one learns how logic works that way. As a practical solution to a problem, or for a commercial product, the PIC might be better, but if one is trying to glean some knowledge of TTL, then it is no help.
<hr></blockquote><p>OK, this has been brewing for a while and I'm not trying to pick (pun semi intended) on any one person as I've heard this many times before. <p>It never fails to amaze me how many people have a knee-jerk reject the use of a microcontroller - "Killing a fly with a nuke", "too complex", "obscures how it works", "voodoo", and so on. What is funny about the above comment is that that was, I believe, the first mention of PIC in the thread it was posted under.<p>The history of electronics is repleat with new technologies supplanting old to significant benefit. When you can replace an older way of doing something with one for less money, smaller, more reliable and more accurate, the industry has been quick to embrace it. Yet, there are a lot of people that adamantly reject the use of the microcontroller. <p>
Perhaps they think its too costly or too complex or what ever. To be clear, there are times when I dont recommend the use of a uC. You can see posts of mine that say exactly that. Yet, I think they are responding with out knowing the realities of todays microcontrollers.<p>Here are the points I've heard made against uCs:<p>- costs too much. in reality, low end uCs are becomming as cheap as the ubiquitous 555 timer. 6 pin PICs go for 70 cents in small quantities. I've heard of AVRTinys going to for a quarter! When you consider support circuitry, the uCs are often way ahead. Consider a timer, you can build a timer circuit with a small PIC with *nothing* else - just the PIC. The 555 solution takes a couple of Rs and Cs. Granted its not much of distinction but pretty much they are at parity (of course, you can control the duty cycle on the PIC while its tricky on the 555). Then consider a dual 555 solution - still only takes one PIC. The benefits accrue as the features go up.<p>- too complex. well, that is opinion. Reality is that there is a learning curve for every electronic part you can think of, even the lowly 555. Not that a PIC or AVR is in the same category but the uC is not some gaping beast waiting to eat your brain. The PIC timer code mentioned above can be done with a few lines of BASIC, C or Assembler. The HW is often a lot simpler. Especially if you are doing more complex things.<p>- development tools are too expensive. nonsense! You can buy a programmer for less than the cost of a one year subscription to Nuts & Volts. How much do people have invested in their tools and instruments? I bet even the lowliest hobbiest has much more than $25 invested. <p>- way too steep learning curve. well, this is again opinion. How steep a learning curve is it to go from knowing nothing about electronics to using a 555 to build a timer circuit? I think that's actually steeper than learning about uCs. And frankly, uCs are not that hard to learn - if you set your mind to it. <p>- it obscures the logic of the circuit. one could make that argument against the 555 (and some probably did). Frankly, I think uCs make the logic of the circuit much more clear to the designer - I want a 4 mS period with 1 mS high and 3 mS low in the timer case vs fiddling with the value of R1 and R2 and C until you get it sort of right. Sure, people can get caught up writing the code but there are many sources of diversion, uC or not. What i don't get is why one has to learn about TTL (er, 74xx logic parts??) - that's just one way of doing logic and there is nothing sacred about it. Frankly, a couple of lines of assembler is just as valid as a couple of 74HCxx parts wired together. Education is served in both cases.<p>Finally, the benefits of uCs are amazing. <p>Control. You have nearly complete control over what comes out of the pins of the uC. In the timer example above, you can control the duty cycle, you can add 3 more timer pins, you can create arbitrarily long delays, you can go into a quiescent state that consumes nanowatts waiting for external input and so on. <p>Flexibility. This is the corollary of control. Imagination is the limit.<p>Easy to update and fix. You can change the program at will if it doesn't work right. No need to change the HW. You have to start changing Rs or Cs or worse with a non-uC design.<p>There are many more benefits but this is getting a bit too long.<p>[ January 22, 2005: Message edited by: philba ]</p>

User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: PICing it or How I learned to love Microcontrollers

Post by Chris Smith » Sat Jan 22, 2005 1:41 pm

When PICs move out of their diapers and past the the beta stage, then all the sales pitch in the world wont be enough to get them to market fast enough. <p>Til them, they are a useful tool for some, mildly amusing growth for others, and a pain in the ass for the rest. <p>When You grew up grinding your baby teeth behind all the scenes that brought us the PIC, and then the baby walked his first steps, you don’t sign that baby up for college just yet?<p> Im certain the evolution of the PIC is just beginning, and while the first baby steps may impress some, Im not signing up for the band wagon until all four wheels are fitted, balanced, and rotated a few time over. <p>Remember the beta VCRs? Better than the VHS VCR, and it still died. <p>
Til then, like watching any child grow up, its mildly amusing but not earth shattering watching this baby grow. Survival of the fittest will tell.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by philba » Sat Jan 22, 2005 2:37 pm

PICs have been around for about 15 years. Hardly a baby. But then I doubt anything I could say will change your mind.

User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: PICing it or How I learned to love Microcontrollers

Post by Chris Smith » Sat Jan 22, 2005 2:48 pm

Some children waddle well into their teens. <p>They all grow up, or die. <p>We will see with the pic, just like the beta recorders. <p>Primative might work, but its nothing to cheer about. Ive seen better, I will continue to see better in the future. Til then its still a novelty trying to grow some legs.

JKMADSCI
Posts: 17
Joined: Tue Nov 19, 2002 1:01 am
Location: QUEENS
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by JKMADSCI » Sat Jan 22, 2005 5:17 pm

And what would you use to control an lcd if no
pics were allowed?

User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: PICing it or How I learned to love Microcontrollers

Post by Chris Smith » Sat Jan 22, 2005 5:33 pm

Life before the PIC, well documented.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by philba » Sat Jan 22, 2005 11:28 pm

<blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr>Originally posted by Chris Smith:
Life before the PIC, well documented.<hr></blockquote><p>That's a good one! Lets see, a big old eprom (and a programmer) with a sequencer, timing logic for the display and some TTL to figure out where the specific strings start vs a single 18 pin package (for about $2.50). I bet you couldn't even come close to a microcontroller for that application. Heck you'd be halfway to inventing a uC at that point. Sorry, Chris, that dog don't hunt.

rshayes
Posts: 1286
Joined: Tue Mar 04, 2003 1:01 am
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by rshayes » Sat Jan 22, 2005 11:36 pm

Microcontrollers are good for some purposes and terrible for others.<p>They are definitely a poor choice for safety interlocks. They can hang up. So can any processor, including Pentiums. Several years ago a commuter train in San Fransisco went through a station, off the end of the tracks, and into an open field while carrying passengers. The cause was a broken wire in a clock crystal. No clock; no stop command.<p>For some purposes, they are too slow.<p>They are flexible. One byte in can cause execution of any one of up to 256 subroutines, each of which can consist of entirely independent operations.<p>Their are several alternate approaches. For a small number of fixed sequences, a state machine may be simpler. This may be as simple as a latch and a PROM.<p>Sometimes a look up table in a PROM will work.<p>If a large number of synchronized signals are needed, a programmable logic device might be better. Some of the CPLDs made by Xilinx and distributed by Digi-Key are only a few dollars. The programming software can be downloaded from Xilinx, and the programming interface is about $10 worth of parts driven by the parallel port of a PC. The source file can be a schematic instead of a program.<p>The best solution depends on what needs to be done. Sometimes that is a PIC; sometimes it isn't.

User avatar
philba
Posts: 2050
Joined: Tue Nov 30, 2004 1:01 am
Location: Seattle
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by philba » Sat Jan 22, 2005 11:59 pm

Just to be clear, I said microcontrollers, not PICs. I would guess that CPLD, FPGAs and so on are well beyond uCs in the mind of the objecters. After all, those are big, complex programmable systems. lol. I'm learning about xilinx FPGAs - my next personal challenge. 50K gates for about $12, sweet.<p>There are times when you need the speed, as you mentioned. Good example where a uC wont work, at least with out some help. <p>By the way, in your exact reliability example, Renesas (Hitachi uC spinoff) has added an oscillator fall back provision to their uC line. When the external oscillator input is interrupted, it falls back the internal oscillator with an interrupt so the software can initiate some sort of soft fail (or what ever).<p>We could have a fine discussion on why reliability engineering is independent of whether a uC is being used but perhaps some other day.<p>Phil<p>[ January 23, 2005: Message edited by: philba ]</p>

terri
Posts: 404
Joined: Sun Nov 07, 2004 1:01 am
Location: colorado
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by terri » Sun Jan 23, 2005 2:24 am

Philba:<p>OK, so I've been wanting to get into uCs for quite a while because I've come across situations where one would do just jim-dandy.<p>So, if you were to develop a minimum "starter kit," what would be in it?<p>What books would I need?<p>What hardware should I go out and buy?<p>What ancillary "stuff" would be needed? (What do you reach into your junkbox for when you're doing a project?)<p>Assume a basic knowledge of programming in your "student," i.e., addressing, hex, ASCII codes, etc.
terri wd0edw

User avatar
dr_when
Posts: 208
Joined: Thu Oct 28, 2004 1:01 am
Location: Milwaukee
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by dr_when » Sun Jan 23, 2005 3:42 am

I learned Microcontrollers & Microprocessors 20 years ago without ever touching hardware...at first. I bought a Z80 and an 8051 Simulator from a company whose name escapes me at the moment. I was able to get very familiar with the instruction sets and operations while sitting in front of a PC (or in one case it was a Commodore 64 running a simulator).<p>I would start with PIC's MPlab which is free and lets you "play" without any investment. Then go buy a cheap PIC development board from Digikey and play with LEDs. Once you get the hang of outputs play with inputs like A2D. I am amazed at how cheap one can get into "embedded" development these days as the companies have made the tools so affordable (until you go "pro" and need production quality tools. But that's a story for another day.<p>Bob
"Who is John Galt?"

JB-82-Delft
Posts: 9
Joined: Wed Jan 19, 2005 1:01 am
Location: Delft
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by JB-82-Delft » Sun Jan 23, 2005 3:57 am

It's a matter of costs / quality ratio. Not a matter of evolution.
I expect the PIC to be along quite a while. As will be the FPGA. I'd rather see VHDL disappear, it's a stupid language.<p>Also, everything you would want to learn on PIC (assembler) and FPGA (VHDL) is found the this splendid net.<p>[ January 23, 2005: Message edited by: JB-82-Delft ]</p>

ian
Posts: 251
Joined: Mon Feb 25, 2002 1:01 am
Location: toronto
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by ian » Sun Jan 23, 2005 6:12 am

You guys are cracking me up. I can't believe there's even a debate about this. Microcontroller technology has advanced leaps and bounds since the day of 68HC or 8031's. I think micro controllers are decades behind what's possible and PIC's are just the beginning. I think the days of EPROM's are over. Those old, outdated packages are trying to hang on by offering built in flash but it's only for old farts who are entrenched and trained in the technology. All code is going to be downloadable, soon and more features will be built in, say goodbye 8051, 68HC, Z80.

User avatar
Chris Smith
Posts: 4325
Joined: Tue Dec 04, 2001 1:01 am
Location: Bieber Ca.

Re: PICing it or How I learned to love Microcontrollers

Post by Chris Smith » Sun Jan 23, 2005 7:48 am

"That's a good one! Lets see, a big old eprom (and a programmer) with a sequencer, timing logic for the display and some TTL to figure out where the specific strings start vs a single 18 pin package (for about $2.50). I bet you couldn't even come close to a microcontroller for that application. Heck you'd be halfway to inventing a uC at that point. Sorry, Chris, that dog don't hunt."<p>I guess some are better at design work, than others? And some take a aspirin at the drop of a hat for all that ills them.

terri
Posts: 404
Joined: Sun Nov 07, 2004 1:01 am
Location: colorado
Contact:

Re: PICing it or How I learned to love Microcontrollers

Post by terri » Sun Jan 23, 2005 9:59 am

OK. Acrimony and youthful exuberance aside, Ian and Chris, I repeat my question for your particular favorite control devices / mechanisms:<p>If you were to develop a minimum "starter kit," what would be in it?<p>What books would I need?<p>What hardware should I go out and buy?<p>What ancillary "stuff" would be needed? (What do you reach into your junkbox for when you're doing a project?)<p>Assume a basic knowledge of programming in your "student," i.e., addressing, hex, ASCII codes, machine language and assembly language coding, etc.<p>[ January 23, 2005: Message edited by: terri ]</p>
terri wd0edw

Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests