Author Topic: PIC microcontrollers  (Read 8728 times)

0 Members and 1 Guest are viewing this topic.

Offline bearmanTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
PIC microcontrollers
« on: August 14, 2010, 07:08:57 am »
I just recently rekindled my electronics hobby.  I pretty much quite after finishing night school and graduating from college.  This was 1989.   I got tired of it because computers became more and more a requirement for working with microprocessors and memory chips and such.  Computers were way below my tolerence level for doing boring repetitive crap with them as they were back then.   

I was laid off January of 2009 and started digging in to things I haven't touch in years.   I looked into microcontrollors I figured I would go to Radio Shack and buy a Basic Stamp system and relearn microprocessors or microcontollers as they are called today since they are dedicated to control.  PCs are a million times more friendly to use now and the web is a phenominal change over begging for data books from manufacturers and buying crossreference books to find pin outs of any component.   

I almost bought the Basic Stamp when I saw the price of a USB to serial converter cable was needed and cost $60.00.  That was 2/3 the price of the Basic Stamp kit.  I freaked.  The Sales man saw my reaction anmd called me over.  He said look up Arduino.  I said what???  I said write it down.  Then he said get it at Adafruit.  I said write that down too.  Well I discovered Arduino and the IDE environment.  I got a board and usb cable for $30 and free software from the Arduino site and I was on my way for half  the price of a tank of gas.  I have been chugging along practicing my programming  and retrained myself on Arduino C code and I am excited and overwhelmed with the new possibilities I have available to me through the Arduino system.  I have since built 8 useable projects that I wanted to make years ago but did not have the patience or need to drop the required cash to make them back then.  The Arduino has eliminated the need to design dedicated digital logic cicuits for a specific task.   Now I can program what I need and I can get one chip to do it for $5.00.  What a concept!!   

Well now that I am hooked on the microcontroller concept I would like to dabble with PIC chips.   I would like to use them for very basic projects  since there is a cost savings per chip and per internal clock for non timing critical apps. 

HERE IS THE QUESTION.    I am NOT looking to get into relearning how to manipulate bits and bytes in various registers again like I did for the 8085  I worked with 20 plus years ago.  What is the simplest way for me to program PIC micros that is similar to the Arduino IDE.  The Arduino system makes is so easy and fun to make things.   What C compiler and minimum support stuff would you guys recommend for getting into programming PICs?   I think I would like to work with PIC16XXXX or lesser micros. 

Sorry for the long story but I wanted to reiterate what Dave said a while back about how electronics things are tons easier to manage today than 20 or 30 years ago.  It is a pleasure to work with it these days.

THANX ALL

Bearman
Work is for people that don't know how to fish.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 18201
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: PIC microcontrollers
« Reply #1 on: August 14, 2010, 07:44:25 am »
welcome aboard bearman, yes things have come a long way, I finally took up MCU's because I could see it was the way things were going and I came to recognize that I could make projects more sophisticated, cheaper, smaller and flexible with the wonders of MCU's. I suppose i choose pics because that is all I'd heard of on another forum and after feeling frustrated for 2 years trying to program in assembler i picked up MikroeBasic (mikroe.com) and it has put me leaps and bounds into being able to quickly and easily get done what I want. They also have a C compiler but i know nothing of C, someday I suppose I'll have to go for it, I'm a terrible programmer and get by doing simple stuff with basic. My "jellybean" pic is the 12F615, I think it is one of the more "armed with features" pic of the 12F range and I can bulk buy them knowing I'll be using them sometime (or reselling them), The guy that first set me up with my first flashing led program over an msn chat (I'll never be able to thank him enough) recommended the 16F88 but I soon fell to using the 12F615 when I realized I did not need large chips for most of my projects. The pickit2 is a great programmer and supports most of the small end pics.
« Last Edit: August 14, 2010, 07:46:12 am by Simon »
 

Offline GeoffS

  • Supporter
  • ****
  • Posts: 1272
  • Country: au
Re: PIC microcontrollers
« Reply #2 on: August 14, 2010, 09:24:27 am »
Hi Bearman,
There are any number of cheap PIC based development/prototyping boards, check out sparkfun.com as a start.
For development software, check out MPLab from Microchip (makers of the PIC processor.  It's a very comprehensive IDE and it's free.

If you're preferences run to programming in BASIC, then check out the Picaxe www.picaxe.co.uk/ chips. Loads of fun!
« Last Edit: August 14, 2010, 11:59:38 am by tumutbound »
 

Offline saturation

  • Super Contributor
  • ***
  • Posts: 4787
  • Country: us
  • Doveryai, no proveryai
    • NIST
Re: PIC microcontrollers
« Reply #3 on: August 14, 2010, 11:56:05 am »
Best Wishes,

 Saturation
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: PIC microcontrollers
« Reply #4 on: August 15, 2010, 06:10:07 am »
I do a lot with the PIC and the AVR (guts to the Arduino) and even ARM. I am primarily a C guy, but I have to tell you that the 16F PICs do not have a very good architecture for C. The later models (18F etc.) are better for C but not as popular. Not that you can't get C for the PIC, it just usually generates ugly code.

On the other hand there are Basic compilers and Forth compilers for the PIC that are really great. PIC Basic Pro isn't free but it quickly pays for itself. The Forth compiler is free but not well maintained which is a pity because it is a beautiful setup.

I have a lot of tutorials including on Forth and other things at http://www.awce.com/classroom and http://tutor.al-williams.com

As for the Arduino, its nice but really its just an AVR, GCC, and an IDE with a boilerplate main().  Look up the Procyon library for AVR and learn how to use it. I'm not a fan of the Arduino boilerplate or the IDE, but then I'm an old CLI guy, so....

And just to give you something else to think about, the ARM boards can be had for very little money and have the capability we'd have expected in a PC 10 or 15 years ago. I'm getting where if I am only making one of something I use those. Oddly I sell PIC and AVR hardware, but no ARM hardware but the cost is awfully low on them for how much compute power you get.

Just my ramblings,

Al http://www.hotsolder.com

 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 39745
  • Country: au
    • EEVblog
Re: PIC microcontrollers
« Reply #5 on: August 15, 2010, 08:22:51 am »
HERE IS THE QUESTION.    I am NOT looking to get into relearning how to manipulate bits and bytes in various registers again like I did for the 8085  I worked with 20 plus years ago.  What is the simplest way for me to program PIC micros that is similar to the Arduino IDE.  The Arduino system makes is so easy and fun to make things.   What C compiler and minimum support stuff would you guys recommend for getting into programming PICs?   I think I would like to work with PIC16XXXX or lesser micros. 

By far the easiest way to get an app running is with the PICAXE, you can even program them using flowcharts, no code required.

If you ultimately want the power of a raw PIC in C, then the PICkit3 with MPLAB and the free HITECH C compiler is the best bet.

Dave.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: PIC microcontrollers
« Reply #6 on: August 15, 2010, 02:31:12 pm »
HERE IS THE QUESTION.    I am NOT looking to get into relearning how to manipulate bits and bytes in various registers again like I did for the 8085  I worked with 20 plus years ago.
you onced had a skill that many of other programmers envy (or even dont care about). anyway, you got a sad story there, welcome to the club. i still remember how easy it was programming in Arduino IDE. but i moved to something else for programming mcu's. But first, you need to have MPLAB, Pickit Software and Hardware Programmer. Then i only can suggest download program examples from Internet for learning.

Others may have suggested the most simplistic software (PICAXE or BASIC) but i never care to try them out, i'm quite happy with what i have right now. So far, the easiest C programming the MCU i have is the Arduino IDE. If you think BASIC is your flavor, go for it. BASIC or C, they are just the same, ie programming language, your imagination limits.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline bearmanTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: PIC microcontrollers
« Reply #7 on: August 18, 2010, 06:47:51 am »
THANX everyone for responding.    International assistance.  What a concept.  COOL.

I agree Basic and C are the same but different.  C seems to be more flexible from my limited experience.   

I reviewed the links everyone provided.  Good sources for further investigation.  Those will be helpful.

Overall it sounds like getting a Pickit and MPLAB will be in order.  HITECH C looks like what I will want to use based on above responses and other threads I have read on the forum seem to be the way I would want to go.

I think I would like to read up on HITECH C before I commit to anything.   

I see where a lot of very basic things I want to make would be well served by the 8 pin PICs.  The small physical size would be a plus also. 

The PIC MCU choices seems extremely overwhelming also.  How do you pick one?  From what I have read everyone seems to have their own favorites.

Is there a source where I can view HITECH C commands with good descriptions of how they directly relate to various PIC's architectures, features and ports?  That may be my deciding factor.

Thank you all again. 

Bearman 







Work is for people that don't know how to fish.
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 39745
  • Country: au
    • EEVblog
Re: PIC microcontrollers
« Reply #8 on: August 18, 2010, 07:04:15 am »
THANX everyone for responding.    International assistance.  What a concept.  COOL.

I agree Basic and C are the same but different.  C seems to be more flexible from my limited experience.   

I reviewed the links everyone provided.  Good sources for further investigation.  Those will be helpful.

Overall it sounds like getting a Pickit and MPLAB will be in order.  HITECH C looks like what I will want to use based on above responses and other threads I have read on the forum seem to be the way I would want to go.

I think I would like to read up on HITECH C before I commit to anything.   

I see where a lot of very basic things I want to make would be well served by the 8 pin PICs.  The small physical size would be a plus also. 

The PIC MCU choices seems extremely overwhelming also.  How do you pick one?  From what I have read everyone seems to have their own favorites.

It depends on your design requirements. It's surprising how few PICs it actually comes down too when you start to narrow the requirement (I/O, features, package, price, availability etc)
The Microchip parametric search tool is very useful. As are the supplier searches like Mouser and Digikey.
http://www.microchip.com/productselector/MCUProductSelector.html

Quote
Is there a source where I can view HITECH C commands with good descriptions of how they directly relate to various PIC's architectures, features and ports?  That may be my deciding factor.

Download the Lite version and look at the example programs.
HI TECH C uses the exact same register names as used in the PIC datasheet.
So if you see the register is called TRISA, you can simply go TRISA=0; etc
That makes it pretty easy to use.
The hard part in using PIC 9or any other micro) is knowing what registers to set up and how.
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en542849

Dave
 

Offline DJPhil

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: 00
Re: PIC microcontrollers
« Reply #9 on: August 18, 2010, 07:06:39 am »
International assistance.  What a concept.  COOL.

This is one of my favorite things about this forum! We should make a map, I might just be the loneliest dot.  ;D

Is there a source where I can view HITECH C commands with good descriptions of how they directly relate to various PIC's architectures, features and ports?

Very good question, I'd be interested to hear if anyone has a favorite print (or printable) book on HITECH C. There seem to be dozens of pic programming books.

I dug up a link to the forums, though they seem sparsely traveled I'm sure it'd be a good place to get specific answers. It's worth noting that it's a community, not an official support forum.
Microchip has a lot of resources, including a HITECH C faq that might be a good starting point.
Microchipfault is a (soon to be) reputation based Q/A . . . site? It looks like a familiar web app, but I can't place it. Again, looks useful for specifics.
Microchip has a youtube channel with a heap of video, and a quick search turned up a couple on HITECH C.

It won't be long before I dive into this world myself, so I'll be collecting resources as I go.

Hope that helps :)
 

Offline djsb

  • Super Contributor
  • ***
  • Posts: 1015
  • Country: gb
Re: PIC microcontrollers
« Reply #10 on: August 18, 2010, 02:26:20 pm »
Is there any reason not to use the lite/student version of Microchips own C compilers. The student version is free and only limited in code optimisation. The only reason I use it though is because of a book I'm working from which uses the Microchip tools.
There's also a basic compiler called great cow basic which you could try. I've also used CCS compilers for some code written by Peter H Anderson which he uses in his tutorials. You can google all the above.

David.
« Last Edit: August 18, 2010, 06:00:53 pm by djsb »
David
Hertfordshire, UK
University Electronics Technician, London, PIC16/18, CCS PCM C, Arduino UNO, NANO,ESP32, KiCad V8+, Altium Designer 21.4.1, Alibre Design Expert 28 & FreeCAD beginner. LPKF S103,S62 PCB router Operator, Electronics instructor. Credited KiCad French to English translator
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline bearmanTopic starter

  • Regular Contributor
  • *
  • Posts: 53
  • Country: us
Re: PIC microcontrollers
« Reply #12 on: August 19, 2010, 08:02:39 am »
THANX AGAIN!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I will take all of the latest advice and do some homework now.   Sounds like it actually won't be too painful. 

Sounds like choosing a PIC should be relatively simple once I review the choices.  Sounds managable.

HITECH C sounds like it will be intuative.   

I appreciate the great feedback.

Do you guys buy directly from Microchip or from the likes of Mouser and Digikey?   Sounds like I would go directly to Microchip for the Pickit and MPLAB stuff.  I know once I start diving in seriously I am going to want chips "NOW" to experiment with. 


Bearman
Work is for people that don't know how to fish.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf