Author Topic: Getting started with PIC16F877A  (Read 3330 times)

0 Members and 1 Guest are viewing this topic.

Offline hussamaldeanTopic starter

  • Supporter
  • ****
  • Posts: 282
  • Country: iq
Getting started with PIC16F877A
« on: December 24, 2018, 03:45:19 am »
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 uC
is 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
 

Offline septer012

  • Regular Contributor
  • *
  • Posts: 68
  • Country: us
    • http://www.danielbjohnson.net
Re: Getting started with PIC16F877A
« Reply #1 on: December 25, 2018, 07:46:09 am »
Predko's book: https://www.amazon.com/Programming-Customizing-Microcontroller-Michael-Predko/dp/0079136451

Also 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.
« Last Edit: December 25, 2018, 07:55:47 am by septer012 »
Daniel
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3550
  • Country: ca
Re: Getting started with PIC16F877A
« Reply #2 on: December 25, 2018, 03:03:15 pm »
Whatever you do, don't extend your knowledge to old and obsolete parts. Consider new PICs - PIC16F1xxxx -where xxxx is any 4 digits.
 
The following users thanked this post: cobusve

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4660
  • Country: us
Re: Getting started with PIC16F877A
« Reply #3 on: December 25, 2018, 07:36:45 pm »
Quote
Consider new PICs
+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.
 

Offline hussamaldeanTopic starter

  • Supporter
  • ****
  • Posts: 282
  • Country: iq
Re: Getting started with PIC16F877A
« Reply #4 on: December 26, 2018, 03:52:36 am »
Whatever you do, don't extend your knowledge to old and obsolete parts. Consider new PICs - PIC16F1xxxx -where xxxx is any 4 digits.
well, let me get started then when I get money or when they will be available here in iraq I will buy it
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4660
  • Country: us
Re: Getting started with PIC16F877A
« Reply #5 on: December 26, 2018, 05:41:07 am »
Quote
when I get money
Interestingly, 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.)


Quote
when they will be available here in iraq
Yes, that might be a problem...   :-(

 

Offline hussamaldeanTopic starter

  • Supporter
  • ****
  • Posts: 282
  • Country: iq
Re: Getting started with PIC16F877A
« Reply #6 on: December 26, 2018, 11:27:24 am »
Quote
when I get money
Interestingly, 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.)


Quote
when they will be available here in iraq
Yes, that might be a problem...   :-(
well, I asked around today and nobody knows what I am talking about
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3550
  • Country: ca
Re: Getting started with PIC16F877A
« Reply #7 on: December 26, 2018, 03:54:57 pm »
well, let me get started then when I get money or when they will be available here in iraq I will buy it

You should be able to buy directly from Microchip:

http://www.microchipdirect.com/
 

Offline hussamaldeanTopic starter

  • Supporter
  • ****
  • Posts: 282
  • Country: iq
Re: Getting started with PIC16F877A
« Reply #8 on: December 26, 2018, 04:34:51 pm »
well, let me get started then when I get money or when they will be available here in iraq I will buy it

You should be able to buy directly from Microchip:

http://www.microchipdirect.com/
microship and TI sites don't work here in Iraq
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10088
  • Country: us
Re: Getting started with PIC16F877A
« Reply #9 on: December 29, 2018, 05:35:48 pm »
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.
 

Offline hussamaldeanTopic starter

  • Supporter
  • ****
  • Posts: 282
  • Country: iq
Re: Getting started with PIC16F877A
« Reply #10 on: January 02, 2019, 07:52:09 am »
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.
I am programming Arduino,esp32,stm32 just for being easy to upload the code without have to think if this software will work or not
on another hand, I program ATMEGA328p without the overhead by the idea by disabling the unnecessary interrupt and functions but sometimes they are so handy
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->