PIC Microcontroller Programming - PIC AS Assembler using MPLAB X IDE, Blinking LED

preview_player
Показать описание

This video is a little crash course on how to program a PIC microcontroller. I am using the PIC AS assembler, which is the newer version of the Microchip Assembler, and I will be programming using a PIC 12F675, though you can probably follow along with other mid-range devices.

We will be using MPLABX, and demonstrating many of the features which are useful when programming and debugging PIC microcontrollers.

Keep the above manuals handy whilst programming these devices! In addition to the above references, I recommend some great videos I have found on YouTube. The following list are videos I recall watching and enjoying, so have a watch if you like:

Software used to make this vid:

Рекомендации по теме
Комментарии
Автор

I remember a couple years ago, a video like this would’ve been so boring to watch. Back then I didn’t comprehend anything related to Programing, and had to “Force Feed” this knowledge. 😂 Now I can listen along and visualize what’s going on in my head.
Big difference, almost Night/Day.

Your videos are easy to follow along with now.
Thanks for all your time, it does pay off.
God Bless.

jjqformerlyjailbreak
Автор

That was brilliant, thank you so much for putting this together! My first engineering job back in 2002 was as an embedded systems designer using a Microchip PIC as our microcontroller (I don't remember which family, maybe PIC16F). I got to write firmware, I even designed some of the PCBs we use. I was so excited when my first PCB arrived from the fab house! I mounted and soldered the components on with such pride, and the best part was it worked! Unfortunately, that job only lasted a little over a year, and I haven't touched any embedded systems since then. Something recently triggered the itch in me to get back into it as a hobby, so here I am some 20 years later trying to re-learn PIC assembly to build some fun little automation projects for around the house and camper. Thank you!!

thirstywatersfreeaudiobooks
Автор

Creel, you are a GOOD man!!!. Thank you very much for the Blink PIC tutorial! While by now, April 19, 2023, MPLAB X is v6.05, and I got some syntax errors, while using your code when compiling for a PIC12F629, you gave me enough info fix them, and to my amazement my little PIC is blinking the LED on the first I could not believe it!. Now, that I managed to go through this tutorial, I have to figure out why some code written 19 years ago no longer compiles under MPLAB X. I have a fighting chance due to you.... Thank you very much.

danielfischer
Автор

I have just written the same code for a PIC16F84A using XC8 (pic-as) v2.36 found it kept generating multiple syntax errors, starting at MOV32L instruction.
After much frustration and web trawling and reviewing the tutorial 5x+, I ended up downgrading the compiler toolchain to XC8 (pic-as) v2.32, as used in tutorial.
It built successfully to my suprise !! I am so happy, great tutorial. Thanks.

andyfarquhar
Автор

I have been trying the first Blinky on a PIC16F628A about 6 years ago... and, yes, it was on a breadboard with a Green LED, and a tear of nostaiga falls off my eye.
I did it in MPLAB IDE 8.92 (and only now I realise how old school it is).

Now I am toying around with STM32 programming and, looking back at my memories I see how easy and fun PICs to program.

Seeing this introduction video really made my day. Keep it up with the content.❤️

AndreiM
Автор

"you need to get the datasheet", what an understatement

_..---
Автор

Just a note, Watchdogs should NOT be resetting your chip frequently. The point of a watchdog, if used properly, is to reset the microcontroller if some bug causes it to get stuck in an infinite loop of become unresponsive somehow. In normal operation, you periodically reset the countdown so it doesn't reset you. But if you get caught in an infinite loop or your code gets derailed by a rogue pointer, the timer won't be reset so the micro gets reset once the countdown completes.

MD-vsff
Автор

Please, make more PIC's tutorials !
Make a mini-series with them.
Also, explain more in depth the PIC memory blocks, the register file map, special function registers, etc.

qx
Автор

thank you for sharing your knowledge and being so enthusiastic in every video you make. I'm halfway through your assembly course just sort of peeking at this project now seeing how you set stuff up. thanks for teaching an old dog some new tricks.

larsfinlay
Автор

this took me back to microcontroller class
Honestly, what limited programming we've seen i liked this the most

Masztufa
Автор

ridiculously complex this is nuts and bolts you do a great job of it mate.

dalecostich
Автор

Thank you so much for this tutorial. I had a different PIC (PIC16F877A to be exact) but you had explained everything very clearly so, despite having no prior experience, with the help of a datasheet I was still able to make an LED blink.

dominykasc
Автор

I can imagine how refreshing it must be to look at assembler that doesn't have 9 volumes of documentation for a change :)

locusf
Автор

Thank you for video.
The hardest thing is to start with new topic. This tutorial briefly introduces great world of MCU assembly;).

piotrlenarczyk
Автор

PIC micros are my GOTO for most projects. A better starter is 16f. You still need to switch register banks but you can use the ICD (In Circuit Debug) with Pickit and MPLab. So good to be able to step code on the physical device. It makes debugging so much easier. Not disrespecting the 12f, I have used many 12f's and they are very cheap to boot. Also it was great to see you telling people to initialise the comparator and ADC registers. Many hours spent in the early days debugging only to realise the GPIO is being overtaken by internal modules. Great video! 👍

GiBBO
Автор

Any Arduino can also be used as a programmer. The IDE can write the programmer program to the Arduino, then you wire up the victim on the breadboard and set the IDE to use the Arduino as a pass-through. (There are several guides online.)

I've done this reliably with ATtiny chips and it's been a great (and cheap) solution.

khatharrmalkavian
Автор

I'm using an 12F508. No banks, but was able to follow along perfectly fine. Nice one.

JayJay-kimi
Автор

Great work, mate. I'm about to use a PIC to add PS/2 keyboard support to my homebrew 6502-on-a-backplane build.

TroySchrapel
Автор

Your tutorial is greatly needed. Thank you for making it. because .... MPLAB is the ABSOLUTE WOSRT program I have ever used when it comes to installation. One would expect a development platform to have some sort of built-in options for which chip and which language you want to use and install all the needed components for you. But not MPLAB. MPLAB sends you on a lengthy tresure hunt without a map. How lazy of them.

ScottSavageTechnoScavenger
Автор

Two of my favorite things in one video - creel and PIC!

I could be wrong, but I reckon it's "XG ecu" - with ecu referring to engine control unit. These guys seem to make a few vehicle related products. Great little programmer though, I have one and it can program a lot of different devices - MCUs, PLDs, ROMs etc. There is also an open source command line tool available for it (called "minipro") that's runs on Mac and Linux.

TomStorey