Getting started with PIC16F877A - Page 1
Forum section: electronics / general

author: hussamaldean
author_rank: Unknown
timestamp: December 24, 2018, 03:45:19 am
content: Hi all,since I have deep knowledge in programming arduino for embedded system and mechatronics system, I moved to STM32 bluephile esp32 for IoT and now planning to extend my knowledge to include PIC mid range uCis there any book or website to learn it ? and what shall I use ? MikroC or MPLAB XIDE because I am currently confused between both of them (note: I have basic knowledge in MikroC due to course back in university)regards

author: septer012
author_rank: Regular Contributor
timestamp: December 25, 2018, 07:46:09 am
content: Predko's book:https://www.amazon.com/Programming-Customizing-Microcontroller-Michael-Predko/dp/0079136451Also I started using MikroC which was really easy because there was big libraries, how ever I feel it turned into a hindrance, and writing your own in MPLAB is better.

author: NorthGuy
author_rank: Super Contributor
timestamp: December 25, 2018, 03:03:15 pm
content: Whatever you do, don't extend your knowledge to old and obsolete parts. Consider new PICs - PIC16F1xxxx -where xxxx is any 4 digits.

author: westfw
author_rank: Super Contributor
timestamp: December 25, 2018, 07:36:45 pm
content: Quote+1. You might want to consider PIC18, PIC24, or PIC32 as well or instead, if you already have ARM experience. PIC18 is a significantly enhanced improvement over the PIC16 line, PIC24 is an entirely different 16bit architecture, and PIC32 is a 32bit MIPS cpu.

author: hussamaldean
author_rank: Unknown
timestamp: December 26, 2018, 03:52:36 am
content: Quote from: NorthGuy on December 25, 2018, 03:03:15 pmwell, let me get started then when I get money or when they will be available here in iraq I will buy it

author: westfw
author_rank: Super Contributor
timestamp: December 26, 2018, 05:41:07 am
content: QuoteInterestingly, in the US (from Digikey), the pic16f877a is about three TIMES the price of newer, more capable chips like the PIC16F18875 or PIC18F46K40 (two other 40-pin DIP chips.)QuoteYes, that might be a problem... :-(

author: hussamaldean
author_rank: Unknown
timestamp: December 26, 2018, 11:27:24 am
content: Quote from: westfw on December 26, 2018, 05:41:07 amwell, I asked around today and nobody knows what I am talking about

author: NorthGuy
author_rank: Super Contributor
timestamp: December 26, 2018, 03:54:57 pm
content: Quote from: hussamaldean on December 26, 2018, 03:52:36 amYou should be able to buy directly from Microchip:http://www.microchipdirect.com/

author: hussamaldean
author_rank: Unknown
timestamp: December 26, 2018, 04:34:51 pm
content: Quote from: NorthGuy on December 26, 2018, 03:54:57 pmmicroship and TI sites don't work here in Iraq

author: rstofer
author_rank: Super Contributor
timestamp: December 29, 2018, 05:35:48 pm
content: I think the 16F877A would be a great choice if it is easily available but it is a giant step back from where you are with the newer chips. I started with that chip 15+ years ago and I rather like it. I liked the 16F628A even more.At the time, there wasn't a decent C compiler and even today, I would have a tendency to write in assembly language. The learning curve is a little bit steeper but debugging is actually easier because the output of C compilers can be difficult to understand. Plus you will see a lot of code dedicated to banking and paging. The careful assembly language programmer can avoid most of this.As to which toolchain? Load them both and experiment.Since you are using Arduino, you can always program that chip in assembly language or C without the overhead of the Arduino infrastructure. You would use the avr-iibc library and the avr-gcc compiler and you already have them because that's what Arduino uses. This allows you to get right down at the hardware level and the ATmega328P is a very nice chip. I prefer the ATmega128 because it has more pins but, either way, these are great chips to work with. I definitely prefer the AVR architecture over the mid-range PIC.If you want to program the device with ICSP (In Circuit Serial Programming) using avr-dude (Arduino uses it so you already have it), you don't even need to use the Arduino IDE or the bootloader. You can get right down to the bottom in terms of firmware and hardware. I find this easiest to do under Linux using gedit as the editor and Makefiles. It's a very nice environment. I haven't had a lot of success with debuggers so I tend to avoid them.I first bring up the serial port, then I add some conversion routines (copied from "The C Programming Language" by Kerrnighan and Ritchie) and this gives me serial output for debugging. The K&R code doesn't assume a "heap" and I really don't want to get involved with things like malloc() on a small chip.

author: hussamaldean
author_rank: Unknown
timestamp: January 02, 2019, 07:52:09 am
content: Quote from: rstofer on December 29, 2018, 05:35:48 pmI am programming Arduino,esp32,stm32 just for being easy to upload the code without have to think if this software will work or noton another hand, I program ATMEGA328p without the overhead by the idea by disabling the unnecessary interrupt and functions but sometimes they are so handy