Welcome to the fourth tutorial of our simple microcontroller series.
And this one, this is the last one before we actually start programming the microcontroller
itself.
So we're just going to set up the circuit itself.
And then we're going to set up our project in MPLAB X IDE, and do a couple of things
there.
And we'll be ready to go.
And then the next tutorial, we are actually going to be programming things and moving
forward.
So the first thing we need to do is if, from I think there's tutorial two, saw all the
parts you need to get, hopefully you have them in front of you.
And now let's get them going.
So I have my breadboard, I have my PICKit4.
And on it, you can see there's a microcontroller in the center.
And then I have connected to GP2 and GP1, these two LEDs, and then I also have Switch
2 and Switch 1 connected to GP0 through that resistor right there, and GP3 through that
resistor right there.
Now the reason we have resistors on these switches is because just in case you set it
up wrong and/or you have it set up as an output, instead of an input, which is what you're
going to want whenever you use a switch, you have that as an output and then you push the
button or the switch and it goes straight to ground, that means your five volts going
to be straight down, you're going to short it, you're going to blow that unless there's
some sort of protection in there, most likely you're going to blow that pin which is unfortunate.
So I put these resistors in there, just to keep things safe.
Everything else is just connecting things on the breadboard to power to ground.
And then we put in these pins to actually program the microcontroller.
Now in the past I have set it up where I had a .1" header with six on my PICKit 2, on this
one, there's eight pins.
So you could have eight headers and just stick it right in.
And you can actually just plug your PICKit in there like that, and it sits up.
But it puts a little bit of tweakiness in there.
And I decided not to worry about that.
And I just set it up this way.
So you can see what this looks like.
Now, if you want more time to look at this, I highly recommend you go to our website circuitbread.com
where we have the in a nice, beautiful schematic that is easy to follow.
And then you can get this setup and be ready to go.
So, now that we have this part done, let's head over and check out the actual IDE itself.
Okay, so this is your basic what you get when it first opens, I'm not a huge fan of how
much just distracting stuff there is in here.
Like I want to kill that start page and things like that.
All of that's just fluff that we can ignore.
So what we want to do is we want to start a project.
And what we'll do is we'll go through and show how to start a project.
Once we get our project all set up will also create a main file, and then we'll get it
set up so that we can run this programmer to provide power for our circuits, which won't
work in the future, but will work for what we're doing now.
So first, we go to File, and then new project.
And then we will want a standalone project.
Click Next.
And then we can just go here and do one of our baseline 8 bit MCU's.
And finally PIC10F200.
Before moving on, we'll just skip the supported debug header at the moment.
And since I am using a PICKit 4, I'm going to use PICKit4, you got to PICKit 3, or whatever
you can go on.
If you got a PICKit 2, obviously it's not supported by this and you're going to need
to use the other IDE,the older one.
Now, we will use mpasm.
So basically MP assembly.
We're moving on.
And I'm just going to call this Primero, because it is our first project and I'm going to keep
that set as our main project.
I'm just going to keep this under the standard stuff because why not.
And it's that easy.
I mean, we already have a project setup.
It's got the right microcontroller in there, we're good to go.
So now we have our project.
We don't have anywhere to put our code.
So let's create a new file.
We'll just do assembly file dot ASM.
Go on, but we don't want to call it new ASM template because that means nothing.
So we'll do just main and as you can see right here its main.asm again, ASM assembly, just
in case that wasn't obvious.
And then we will go finish.
At this point, you'll want to verify that this is under your project.
So main.asm and you have a blank beautiful project right here.
So that's awesome.
Now one of the interesting things is we talked about one of the differences between MPLAB
X and MPLAB 8.76.
This one I almost never hear the fan starting on my computer but it's starting right now.
So obviously this IDE is quite a bit more intense than the older MPLAB That's not a
big deal.
But I just wanted you to be aware of it that if you have some constraints, you may want
to use the older version of MPLAB.
So now we've got the Project Setup, we've got our main file setup now we just need to
make it so our circuit itself is being powered by the PICKit 4 so we're going to start right
here and to get power we're going to go up to File project properties, Primero, and it's
going to pop up and now on the left mine says PICKit 4 if you're using something else is
going to be something different click PICKit 4 then go over to option categories drop down
to power should be a little bit obvious and then power targets or get from the PICKit
4 and that's it.
So now the PIC10F200 can run at five volts.
So we're we don't have any problem, you end up using a different microcontroller.
And it can only go up to 3.3 volts, you need to make sure that this voltage level is no
higher than the max voltage level of your microcontroller.
And you should be good.
And then you click OK.
And that's it.
Now we are all set up.
So the next step is in the next tutorial, we're going to put some code in there we're
going to learn about what that code is doing.
And we are going to turn on an LED.
I know that is super exciting.
Just control your excitement, but jump right into that next tutorial and get going.
I hope you found this video interesting and also useful.
If you did please give it a like, subscribe to our channel and we'll see you in the next
tutorial.