Beginner in PIC microcontrollers - Page 1
Forum section: electronics / beginners

author: ElectroElvis
author_rank: Regular Contributor
timestamp: December 16, 2011, 09:34:18 pm
content: 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:)

author: 8086
author_rank: Super Contributor
timestamp: December 16, 2011, 09:40:44 pm
content: 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.

author: metalphreak
author_rank: Frequent Contributor
timestamp: December 17, 2011, 04:17:22 am
content: 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 beforehttp://ww1.microchip.com/downloads/mplab/X_Beta/index.html

author: joelby
author_rank: Frequent Contributor
timestamp: December 17, 2011, 08:00:53 am
content: 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!

author: oliver602
author_rank: Regular Contributor
timestamp: December 21, 2011, 01:31:26 pm
content: 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

author: joelby
author_rank: Frequent Contributor
timestamp: December 21, 2011, 10:35:13 pm
content: 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.

author: oliver602
author_rank: Regular Contributor
timestamp: December 21, 2011, 10:52:36 pm
content: 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.

author: caroper
author_rank: Regular Contributor
timestamp: December 23, 2011, 11:14:04 pm
content: Back to the OP's original question, the chosen devicePIC16F690 is NOT well suited toprogrammingin 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.CheersChrisEDIT:Spelling