PIC, do they realy give people headaces?

Discussion in 'Embedded Systems and Microcontrollers' started by BillO, Jun 28, 2013.

  1. BillO

    Thread Starter Well-Known Member

    Nov 24, 2008
    985
    136
    I've been wondering...and it has been on my mind for some time...why is the PIC by far the the MCU most in need of help on this forum?

    Just to let you know, I'm not a 'neophyte'. Experience includes 40 years of (in order) 8080, 6502, Z80, 6800, 6809, 68000, 8051 (and derivatives), PIC, AVR, PIC derivatives (PICAXE), MSP430...

    So why do we see PIC questions most often? I found them, personally, to be a bit of a PIA. So, is that the case universally?
     
  2. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,913
    2,182
    It's very popular (8 bit versions) with beginners in embedded systems and like most things designed to be backwards compatible it's filled with little quirks like banked memory so a program written 10 years ago can still run with little or no modification. Most of the modern 16 and 32 designs are much easier to program using standard software methodologies but dealing with real-world I/O is never plug and play.
     
  3. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    I think the problem with 8bit PICs (bank switching, RMW, tiny stack, etc...) was eliminated with the 18F series. The 18Fxxx is great to work with but seems people still buy 16F parts and they seem downright ancient (PS they are, they're based on the 16C30 from way back when they had to squeeze every little bit)

    I work exclusively with PICs. They offer lots of built in peripheral options often missing on other 8bit micros.
     
  4. panic mode

    Senior Member

    Oct 10, 2011
    1,321
    304
    i guess most people choose to start small. the 8-bit like 12F or 16F pics can be painful for variety of reasons (tiny memory and yet one still needs paging, imho truly lousy software, for long time no cheap programmer or development kit etc....).

    first time i seriously looked at pic, i decided to check out one of the microchip workshops. one needed to register, the seminar was free but one had to pay some $100 for board that was worth $5 and had no programmer (at the time programmer like ICD was over $200, C compiler was several hundreds of dollars etc.).

    in comparison, one could get alternative like z8encore! dirt cheap, programmer was simple and it was included in development kits under $50. the best of all was the software that was a Rolls Royce in comparison to Microchips Ford-T (still is).

    but the DIY community was somehow blind to other options and like any good masochist persisted with PIC16F... result was jungle of clones and hacks as many tried to get their hands on lower cost programmer that didn't look like sardine can. results were mixed, largely due port powered JD programmer and it's clones. i still have that board kicking around. what a disappointment that was...

    at microchip someone eventually clued in what people wanted and pickit was born, finally pic fans had it easy (those who were informed), but as usual marketing department got involved and the venerable (now cured) pickit3 was the outcome.

    the dark ages of making-own pic programmer have left tons of traces on the web and it seems many are still wading through JD waters and same mistakes get repeated year after year.

    today if i work with PIC i try to go with 18F, preferably 24F. otherwise, i just go to Cortex, i like 168MHz, 32-bit, FPU, tons of I/O and ready made development kit for $13. this comes in handy when one is in a pinch and has no time or is simply too lazy to make own board. if someone is starting with PIC today, i'd suggest to consider microstick or... try arduino for example (specially if in need of some holding hands to get going...)
     
    Last edited: Jun 29, 2013
  5. Brian Griffin

    Member

    May 17, 2013
    40
    12
    PIC's the popular microcontroller around, even in the late 90s. Plus, there are a lot of good support tools by Microchip Inc.

    The higher end ones are often loaded with peripherals like USB and recently, DAC. :)
     
  6. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Could be a vicious circle. There are a lot of PIC threads here so if anyone does a little searching before asking the question they could end up here.
    Most of the questions are from people just starting out, once you have a few working projects it gets easier, but it's tricky when you are staring at your first program and have no idea what's wrong with it.
     
  7. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,652
    767
    It took me some time to decide but some years ago I finally moved to the 18F family and felt how easier is to work with them in comparison with the 16F. I started with the 16C57 and learnt my way painfully alone.

    My previous was the 8051 using Basic but albeit quite easy I decided to go the PICs way. If you ask me, I do not know why really...!

    Locally you do not find the MPS340 just to give an example. PICs yes, at many different places.

    Also, any micro could cost here up to 5 times the value charged by Microchip selling directly. Go figure.
     
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Then programming in C. You will not see much of the banking hassle. Why they are popular, well not easy to say. It may be because Microchip quite early recognized the importance in the hobbyist market. The introduction of the PICKIT 2 may also have helped. As it did offer a lot for a small sum of money
     
  9. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Billo: Fundamentally I think it is why we get more questions about transistors but not vacuum tubes: it's just what people use, so the popular products get the most questions.

    Also their past popularity is now a hindrance: I see so many tutorials out there on how to use some near obsolete device, where "near" means "still in productions but not for new designs." People keep trying to cram their project into a device with limited pins and/or memory when for a few cents more they could get a huge amount of both.

    Also many of these tutorials are written in assembly. The only thing worse then learning how to program in C is learning it in assembly. Languages such as Basic were developed as "starter" languages and make a better choice. (There are 3 Basic compilers I am aware of and have good things to say about 2 of them.)

    ********************************************************

    Been those same places as you too. Took my first programming course in 1970, skipped over the 68xx chips but ran thru the 8080, Z80, and the 1802 (my favorite).

    I started with PICs in the 90's when they still needed an 8 bit parallel word to program, and a UV light to erase. Parallel wasn't much of an issue under Win95, and inexpensive (but prone to breakage) UV erasers were around. And MPLAB was always a free download.

    So for a very reasonable start cost one could create embedded devices. No in circuit debugging, but the simulator worked just fine, and led me to my saying "if it doesn't sim you ain't gonna win."

    Eventually the inexpensive PICkit 1 (yes Virginia, there is a PICkit 1) came out and it was amazing. Serial programming (and erase!) was the new thing but the debuggers that could do this were several hundred dollars. The PICkit 1 only worked with a handful of devices, but that was a good list. I added a cable to do ICSP with it and kept on banging out projects.

    You get a very powerful device when you buy a PICkit 2 or 3. The ability to do in circuit debugging is way too powerful to be ignored.

    BTW, the PIC was developed by General Instrument about 5 miles from my house. They sold off that division, and now the building is a newspaper distribution center (and that ain't gonna last for long either). The original Simon hand held computer game used a PIC and took each and every one of it's 512 instructions. I once had one of these chips and bread boarded the game... wish I'd kept that.
     
    djsfantasi and Eric007 like this.
  10. MrChips

    Moderator

    Oct 2, 2009
    12,452
    3,371
    We all have our biases which are unavoidable.

    I had my training wheels writing extensively in assembler on DEC PDP-8, PDP-15 and DG Nova.
    My first microprocessor work was on RCA CPD1802, rapidly followed by Intel 8008, 8080, 8088, 8086, Zilog Z80, S100 CP/M systems. At the same time I was also working on MOSTEK 6502 and Motorola 6800, 6802, 6805, 6809 and 68000, again almost always programming in assembler.

    When the Microchip PICs appeared on the market I dabbled with PIC 12C508 and 16C554. I was horrified by the PIC architecture and by that time I was already a big fan of Motorola 68HC11, in particular the MC68HC811E2.

    The Atmel AVR series, AT90S2313 followed by ATtiny2313 and ATmega8 blew away any thoughts of ever working again with PICs. Admittedly, the appearance of PICkit2 and Hi-Tech C made working with PICs a lot more pleasant.

    Fast forward to the present, programming in C has replaced the tedium of having to learn every new mcu's machine code. You can get by without having to know anything about the chip's internals. However, having said that, if you want a complete understanding of computer technology, you should learn to program in assembler at some point in your career.

    If you wish to be a successful and effective C programmer on any mcu platform, you will need to know the hardware internals of the chip. Knowing assembler will always provide you with a clearer picture of how the code interacts with the hardware.

    For someone now starting out today, my recommendations follow a clearer path, especially if you are on a budget and want to do something in a short time.

    1) If you want to dabble without wanting to learn ASM, start with Arduino. Investment $25.

    2) If you want to learn ASM, C and microcontroller hardware all at the same time, get the TI MSP430 LaunchPad. Investment $10.

    3) If you want real processing power, get the STM32F0DISCOVERY. Investment $10.

    4) If you want to step up to real world computing, get the Raspberry Pi. Investment $50.

    Just my 2 cents.
     
    Last edited: Jun 29, 2013
    Eric007 likes this.
  11. nsaspook

    AAC Fanatic!

    Aug 27, 2009
    2,913
    2,182
    I've done some embedded systems programming on the Pi. As long as you stick to userland programming it's a great chip for general computing and light I/O (Linux GPIO is primitive and limited on the Pi) but it really needs a off-board SPI/I2C I/O processor to really shine on a complex I/O intensive project that a high end PIC controller could handle easily.

    http://farm9.staticflickr.com/8090/8392142229_cdbc95e71c_h.jpg
    PIC18F25K22 I/O processor with Linux kernel module interface replacing the 2 channel ADC on a GertBoard.
    https://github.com/nsaspook/daq_gert
     
  12. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    I'm a satisfied PIC user. I think you have to keep an idea of the kind of projects you're likely to work on, and in my case that is "simple little gizmos". What I want is something cheap that I can get working quickly, and what that actually points to is a processor and programming setup that I don't need to re-learn for every project. So while I can't argue with people who say there are better processors around, the PIC ones are entirely "good enough".

    As for Raspberry Pi, what a joke. If I had masses of data to handle, or lots of numbers to crunch, and I didn't want to use a computer in the project, then it might be worth a look. But if it's a case of reading a few bits or running a motor until sensor A trips, then pause and reverse the motor until it hits sensor B, and send a serial packet to the computer occasionally, the PIC processor is just right. I'm afraid people get drunk on the idea of endless processing power, and it has its uses, but that's not the stuff I do.
     
    ErnieM likes this.
  13. BillO

    Thread Starter Well-Known Member

    Nov 24, 2008
    985
    136
    Speaking of the CDP1802, I have a beautiful blue ceramic and gold one, along with some purple ceramic and gold RAM and white ceramic and gold EPROM I picked up a few years ago before this stuff became as expensive a jewelry. I had intended to make up an enhanced ELF with them. I also have some rarer than hens teeth HP dot matrix LED HEX decoder/driver/display units to go along with it. I guess I should get on to that project. It would never be of any use, but it would be gorgeous. I just need to get some of those little toggle switches with the vinyl dipped levers. Anyone know good source?

    I've had my own Pi for a few months, but other than setting it up and putting it on my home network have never got around to using it. I always seem too busy.
     
  14. Eric007

    Senior Member

    Aug 5, 2011
    1,044
    33
    People here been playing with MCUs way back when I was not even born yet...:D
     
  15. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    True that. And the hope that some of what I've learned will get passed on to the next generation.

     
Loading...