Author Topic: Beginner in PIC microcontrollers  (Read 3599 times)

0 Members and 1 Guest are viewing this topic.

Offline ElectroElvisTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: at
  • http://electroelvis.com/
    • ElectroElvisBlog
Beginner in PIC microcontrollers
« on: December 16, 2011, 09:34:18 pm »
Hello evryone,

i am glad to join comunity of Dave and fellow followers. It is my first and hopefully not the last post here since i am very interested in electronics.

So based on Dave's words on youtube movies i decided to start with PIC simply because Microchip is much bigger company have variaty of microcontrollers....

My question is how do you program PIC's with C(no need for tutorial but just general, which compiler, how to compile ect.) and what would you recommend to start with?

I got myself simple Pickit2 Board with PIC16F690 on it.


I have some simple stuff and tools to work with (if sombody is interested i can write all down)

Thanks:)

Offline 8086

  • Super Contributor
  • ***
  • Posts: 1084
  • Country: gb
    • Circuitology - Electronics Assembly
Re: Beginner in PIC microcontrollers
« Reply #1 on: December 16, 2011, 09:40:44 pm »
Well, the C compiler that comes with MPLAB works. I know many people who use it. I haven't touched C though except for a quick test, I just use assembler. Not for ego or show-off reasons like some people, just because I haven't had complex enough projects to need it.
 

Offline metalphreak

  • Frequent Contributor
  • **
  • Posts: 815
  • Country: au
  • http://d.av.id.au
    • D.av.id.AU
Re: Beginner in PIC microcontrollers
« Reply #2 on: December 17, 2011, 04:17:22 am »
Depending on which series of PIC you are using, you have the choice of either MicroChip's PIC-C or the Hi-Tech C compilers. The free versions of both should be sufficient for most needs. The documentation is quite good if you have a look around the install directory for all the PDFs. I suggest you download MPLAB X if you haven't already. Might as well start learning to use the new interface if you haven't used it before :)


http://ww1.microchip.com/downloads/mplab/X_Beta/index.html

« Last Edit: December 17, 2011, 04:19:07 am by metalphreak »
 

Offline joelby

  • Frequent Contributor
  • **
  • Posts: 634
Re: Beginner in PIC microcontrollers
« Reply #3 on: December 17, 2011, 08:00:53 am »
I second the recommendation for MPLAB X. It's a huge improvement over MPLAB 8. Integration with the compiler documentation is one of my favourite parts, and the editor is significantly better.

One caveat is that the MPLAB X download page gives you older versions of the compilers. You might want to find the newest version of the compiler for your particular PIC elsewhere on the Microchip site. This is probably not a big deal unless you're using a very new series of PIC, but you might as well download the latest and greatest!
 

Offline oliver602

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Beginner in PIC microcontrollers
« Reply #4 on: December 21, 2011, 01:31:26 pm »
I've been trying mplab x for a while now with pic10f series and pickit 3 and I had to go back to mplab 8 as its still too buggy
 

Offline joelby

  • Frequent Contributor
  • **
  • Posts: 634
Re: Beginner in PIC microcontrollers
« Reply #5 on: December 21, 2011, 10:35:13 pm »
What sort of problems were you having with it?

I've been using it with PIC 16/18 and PICKit 3 and it's been fine, aside from some minor cosmetic issues with tab labels being too long and wrapping.
 

Offline oliver602

  • Regular Contributor
  • *
  • Posts: 120
  • Country: gb
Re: Beginner in PIC microcontrollers
« Reply #6 on: December 21, 2011, 10:52:36 pm »
A few issues I've posted in the Microchip forum about. Besides numerous cosmetic issues which weren't really show stoppers, I had a issue with the PICKIT 3 not connecting to MPLAB with a certain firmware version. Java issues in Linux which I think have been sorted now. But the show stopper was the simulator not giving expected results for the PIC10 chip I am using. But I like MPLAB X, and it works in Linux. If it works for you I'd use it over MPLAB 8, but expect a few hurdles, missing features and polish. It is a beta... If you have no time for hassle, I'd use MPLAB 8 untill MPLAB X is a bit more complete.
 

Offline caroper

  • Regular Contributor
  • *
  • Posts: 193
  • Country: za
    • Take your PIC
Re: Beginner in PIC microcontrollers
« Reply #7 on: December 23, 2011, 11:14:04 pm »
Back to the OP's original question, the chosen device  PIC16F690 is NOT well suited to programming in C.
It has paged memory and no stack pointer.
Don't write it off, however, the Tutorial you got with the PICKit2 and Low pin count Board are an excellent introduction to assembler and the basic peripherals contained in thePIC16F690 (My favorite of the 8 bit PIC's) are the same all the way up to the  new PIC32MX family.

You may find a C Compiler that will work, but it will be in efficient, I suggest you use it to learn Assembler.

I may be old fashioned but I am not a masochist, PIC assembler is (relativity) easy, it requires direct register control and when you move to more powerful chips, from any other manufacturer, you will find that you will still have to use direct register access in either C or C++, so you are better off learning it at the lower level.

I certainly don't think I would want to do my first PIC32 project in Assembler, but I sure am glad I was used to doing assembler level access to timers and interrupts before tackling the PIC32 in C.

I think the smallest of the PIC's that can really handle C is the PIC16F877 but am open to correction.

Cheers
Chris

EDIT:Spelling

« Last Edit: December 23, 2011, 11:17:59 pm by caroper »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf