Hello and welcome to this and your last and which we'll talk about the input output the just thoughts.
Francis
in big 16 of my controllers we have two resistors to control input output pins which are trace and post
trace is used to control direction and both are output of each input output pin while port is used to
write all the data from input output pins whereas in pick 18 of there is an additional register.
It's called lat lat stands for poor klatsch as in 16 18 and also uses trace registar to control direction
of each input output pin.
This stuff is used to write output and portraitist that is used to read input.
So instead of having one register which is sport to read and write to output we have flat to write two
output and port to read from input.
So as you can see this is one of the main differences between pick 16 F and big 18 F and pick 16.
If we only have these two registers Tereus and bought.
This is used to assign a certain been in part B.
This board as in both or out.
So in this example if we want to apply this to to pick 16 f
we can see that one means zero output so input output output output output output output and input Borst
of port is used here to send a value or read a value in a certain pin.
So in this case port will send a value to each person that's assigned as out of.
So these pins are all output.
So the value written here will be sent to the port P as output.
And these two bins will use will be used to read input because they have ones in that first register
and we can read the input using this register which sport.
And this was a very good approach at the beginning but it started to have problems while programming.
And one of the most common problems is that it modify the right problem.
We have a lecture on that.
You can check the section that has the name of read modify life problem to identify you know and don't.
Why pick 18 is better than pick 16.
So now as you can see this is the internal structure for controlling the port and pick it up.
Now we have that research which is the same to assign certain been as input or output but in a city
the fun is just that.
Now we have two registers support thunder.
So port is used to read about
why a lot is used to send out.
So if you want to turn on LEDs on port P. You have to send the values in.
This is just stuff like that.
Pick 60.
And if you are familiar with it.
So now we'll explain in the next lesson how to send and receive data and we'll have also a practical
example but for now you need just in all that and pick it up.
We have three registers one for input output just like and pick 16 and 2 for sending and receiving values
unlike pick 16 which has only one which is paused.
Now we have flat for the output and pool for and but for pick it enough.
Now let's move on logic high one here.
As I mentioned earlier that addresses just what makes corresponding pin of PIC microcontroller in boat
y logic low zero at register.
This one
makes corresponding pin out when a pin is configured as in but it will be in high M.B.A. state and its
physical state voltage level can be read using port registers.
So this one is going to be used for reading but
when a pin is configured as output its output logic that will be determined by law to register which
is this one.
This is then you'll think and pick it up one lot of stuff makes a corresponding pin logic high or the
and zero letters just to make a corresponding pin logic low or as us.
So as you can see here we have these values.
So one high zero low latitude just hobbit's corresponding to input pins have no effect on output or
input thoughts.
They are don't care.
As you can see here we have this pen which is don't care and disk bin which is don't care
following points should be noted.
The first point to be noted is that laterite operationalized slat register lat read operation leads
to just touch port flight operation bright light registers port read operation reads.
The physical state or voltage level of all the bands Tharsis you can write outputs using port right
or left or right operation.
But using port like operation is not recommended because it will cause read modify write problem which
we did mentioned earlier.
So it's important to keep in mind that using ptrace port and that must be done with.
Please precise steps so that you can identify what is used for writing what it is used for reading and
what is used for assigning a search term pain as input or output.
That's it for this lesson.
To summarize things we already mentioned that in pick 16.
If we have parsed and trace trace is used for assigning pins as input and output port is used to read
data from pins drive that opens
wine and pick it.
We have three registers.
Trace is used for the very same thing that it was used for and pick 16 which is assigning a board pin
input or out.
The main difference here is that we have a new stuff called Latt that port stuff can be used for reading.
But why not register.
Must be used for writing out.
That's it for this reason.
If you have any question please ask on and I'm here to help you.
Thanks for watching.
And please don't forget to review this course.
Next we will go in a more practical approach.
We'll discuss a code and write it to configure Septem pens so that we can make that idea more clear.
Thanks for watching this lesson.
See you next.
This is educational engineering team.