(light music)
- Welcome to the first of our PIC18F14K50 tutorial series
based in the C language instead of assembly.
Now we're doing this because the PIC10F200 series,
which was based in assembly,
was so popular and because Sergei is amazing.
So unlike in the PIC10F200 where we went into the minutia
of the microcontroller
and understood the registers and how everything went,
we're now moving away from that more theoretical
to the more practical
where we're gonna have a microcontroller
that has a lot more memory space, a lot more features,
a lot more peripherals that you can use
to create many more practical applications.
Not to say that you can't do a lot of very practical things
with the PIC10F200,
but you can do even more with this
and usually a lot simpler.
So the PIC18F14K50 is, has quite a few more pins
than the PIC10F200
and besides just more pins, it has 15 GPIOs
and it has 16 kilobytes of flash memory
and 768 bytes of RAM.
Now it goes up to 48 megahertz of the clock frequency
and you have either one bit timer or three 16-bit timers
so you have several timers to choose from if you'd like.
It has a 10-bit ADC, dual rail-to-rail comparator,
a master synchronous serial port MSSP module
that can work with both SPI and I2C or SPR and I2C.
Also has the UR through the EUSART module
and is capable of full-speed and high-speed
USB device interfaces.
So, it has a lot of different options
for what you wanna do in hardware
versus trying to bit bang it into it in software.
So, I do want to break down a little bit
of what this series is going to look like
just so you have a good idea.
Sometimes we've gotten comments in the
in YouTube
where people say oh, could you explain this line to me?
And I think that's because we haven't communicated properly
that this is the other half of the tutorial series.
The video tutorial that I will be doing not only now
but for the rest of the series,
works hand in hand with Sergei's written tutorial.
And whereas here I will go over high level concepts
and I will pull out different
different points that I think are confusing
and try to explain them
and try and use this video medium as well as I can,
you're going to get a lot out of that written tutorial.
A lot of questions are going to be answered there
because the way Sergei approaches these tutorials
is he says "Here's the problem.
"Here's how we're going to solve it.
"Here's what we're going to use,"
usually some sort of device like a temperature sensor.
He goes into the communication protocol,
explains the protocol,
explains what you have to worry about.
Then he talks about how the entire program
is going to be structured.
And then finally, he goes through his programs line by line,
describing exactly why he's doing everything he's doing.
So, if while watching this you have any specific questions,
definitely go check out the written tutorials.
Sergei goes super in-depth.
There is a huge amount of information in those tutorials
that you should check out.
So, now that I've spent a long time talking about
how amazing those written tutorials are
and I could spend even more time on that,
let's go back into this tutorial
and talk about what we are going to be doing in this series.
So this time, instead of finding the smallest,
cheapest microcontroller we could from Microchip,
we decided to use another eight bit microcontroller
but the PIC18F14K50,
which is going to take a very long time
for that to roll off my tongue
because it certainly does not right now.
Now this is still a relatively small microcontroller.
This is a DIP package that
and frankly the DIP package is the largest of the packages
so you can get it quite a bit smaller
but this is a lot easier to breadboard.
Now the reason we chose this microcontroller
is because it has a lot more features.
So unlike the PIC10F200 where we had to bit bang
almost everything and create a software approach
to any sort of communication or any sort of public,
public pulse width modulation,
this has all of those features built-in.
So it has a has built-in comparators, built-in PWM module,
SPI and I2C interface via master synchronous serial port
I2C, I Squared C, I2C just sounds so dumb.
UART or I like to say UR
because it's a lot easier to say than the E-U-S-A-R-T,
EUSART and this thing even has USB capabilities.
So it is a much more powerful,
much more capable microcontroller.
So besides this microcontroller, if you wanna follow along
in this series,
you're going to need a couple of pieces of software
and a couple of pieces of hardware.
The software is pretty straightforward.
It's the MPLAB IDE, MPLAB X IDE
and I'll go through the installation here.
It's a very straightforward installation.
And then you also need your XC8 compiler
which is what takes the code you write
and makes it into something that a microcontroller
can actually use.
And that's about it from the software side.
Now on the hardware side,
if you do not already have these, you will need a PICkit.
I have the PICkit Four that I'll be using.
Sergei has both a PICkit Three and a PICkit Four
but he likes the PICkit Three.
So in the written tutorials,
he'll probably be referencing his PICkit Three
when it is referenced.
You obviously need the microcontroller itself
which at this moment in 2022,
there is a huge amount of chip shortages going out
so it may be a bit of a challenge
and Sergei provides a couple of different options
that you can use
if you can't find this particular microcontroller.
He provided I think three or four other microcontrollers
that will work just fine
and those are on the website if you want to go find those.
You'll also obviously need need a breadboard
because you need a place to put all of this.
And finally, you'll just need a random assortment of things
like resistors, buttons, switches, wires
and then we will have specific things that we will need
on each tutorial.
So, if you get yourself set up with the breadboard,
the microcontroller, your PICkit, some LEDs switches,
that'll get you through probably the first
half dozen tutorials.
But then we're gonna start doing a little bit
more complicated things.
And right now, Sergei is on.
Well he just finished tutorial number 20
which is a PID controller using a resistor
to heat up a sensor.
It's actually really fascinating tutorial
but at that point, you will need quite a few other things.
At this moment, if you want to do all of this
and you already have the PICkit,
you probably can do everything for about a $100.
That's seems to be about how much all of the equipment
will cost to do all of these tutorials.
So just keep that in mind.
If something's too expensive,
we did try and make it as cheap as possible.
But if something's too expensive, you can still follow along
and get as close as you want and that is entirely up to you.
And so with that,
let's actually do the MPLAB X IDE walkthrough
and just show that installation and get you ready to go.
So this is pretty straightforward.
Let's just go through the process
and we can talk about it really briefly.
There shouldn't be anything too surprising
though by the time you watch this,
this version might be different.
The same general concept should be applicable.
So, let's go next.
I have read all of this in advance, trust me I did
and I'm accepting it just like everybody ever will.
I don't like getting emails
so I'm just going to take those out just because
and I do not have a proxy.
So, if you do, you're gonna have to change that
and that directory looks great.
So honestly, I'm not going to need the rest of these
and I can go back and install these later as it is.
We're going to have to cut out a long time
of this downloading.
But I would like the MPLAB, MPLAB X IDE and the IPE.
I haven't had a lot of success in the past
of doing direct uploading to my microcontroller
through the IDE, though it is entirely possible,
and when it has worked for me, it's been fantastic.
But I'd like the IPE there as well
just in case I need to use it.
So then, we just click NEXT.
Ready to begin installing, click NEXT
and now we are going to be sitting here for a while.
Okay, that was surprisingly painless.
That was a lot faster than I was expecting.
So I do not wanna launch the MPLAB X IDE at the moment
but I do need to get my XC compiler.
So, and just as a reminder,
your IDE is where you do your coding
and it's just basically a tool that helps you with.
It can identify with color or whatever, where
like you know, just helps you with the process
of programming as I tried to say there.
It can color code different aspects of it.
It can match your parenthesis so everything
actually goes together and stuff like that
but it's not actually necessary.
You can do all of this stuff in Notepad
or any sort of text editor.
So the IDE just makes your life a little bit simpler.
The compiler is actually the piece that takes your code
and turns it into something the microcontroller can use.
So let's go get the compiler.
Okay, now we want,
we can go down to download MPLAB XC-8.
All right, compiler downloads
and I don't want Windows.
Let's do Mac cuz I am using a Mac
and I want the XC-8 so I can go and download that
pretty small file.
Let's see what happens.
Yes, Apple is very worried about their security
which I understand.
It's nice sometimes
and a real pain in the backside other times.
So now we are installing the compiler
and this will integrate nicely with the IDE
if everything goes well.
Once again, I am a super fast reader
and I accept that agreement
and I only want the free mode.
If you get the workstation or the network client,
you can get basically the pro mode
and it offers you more features
mostly in making your code even smaller.
But for what we're doing, we don't need to mess with it.
We can just do the free
and let's actually do both of these things.
We want to apply settings to all users of this machine
even though only I use this laptop
and then add XC-8 to the path environment variable.
Now it's ready to begin installing.
So once again, we will probably skip over this
even though it looks like it's gonna go pretty quick.
Okay, so now it's gone through.
I don't have an activation key
and I'm not purchasing a license
and I don't want an evaluation of the pro license either.
So we can just go NEXT, say it's done and fantabulous.
So, everything should be ready to go.
Now I just need to open up my MPLAB X.
Oh, let's go to Applications and find it there.
Okay and so I find my MPLAB IDE
not to be confused with the IPE.
Double click and see how it works.
Okay, so if you get to this point
and you have the IDE and the XC-8 compiler installed,
then you are ready for the second tutorial.
All right. Fantastic.
So that's it with MPLAB.
With your MPLAB IDE and your XC-8 compiler,
you have all the software you need.
If you already have a PICkit
because you did the PIC10F200 series with us,
then fantastic.
All you need is this PICkit, microcontroller, breadboard,
couple resistors, switches, LEDs
and you are off to the races.
I'm very, very excited to get started.
As soon as we're done with this,
I'm gonna be setting up for the next tutorial
in which we will be messing with an LED
and immediately doing more practical, interesting work.
We hope you join us for this series
because it's gonna be an excellent ride.
If you wanna get notified
whenever any of these or other tutorials get published,
please subscribe to our channel, hit the bell,
all that good stuff.
Like this video. (bell rings)
Have a great one.
We'll see you in the next one.
(toaster lever dropping)