1 00:00:01,830 --> 00:00:06,580 Hello and welcome to this and your last and which we'll talk about the input output the just thoughts. 2 00:00:06,580 --> 00:00:06,970 Francis 3 00:00:11,520 --> 00:00:21,810 in big 16 of my controllers we have two resistors to control input output pins which are trace and post 4 00:00:22,830 --> 00:00:32,310 trace is used to control direction and both are output of each input output pin while port is used to 5 00:00:32,310 --> 00:00:45,480 write all the data from input output pins whereas in pick 18 of there is an additional register. 6 00:00:45,950 --> 00:00:58,880 It's called lat lat stands for poor klatsch as in 16 18 and also uses trace registar to control direction 7 00:00:58,900 --> 00:01:02,960 of each input output pin. 8 00:01:03,060 --> 00:01:10,550 This stuff is used to write output and portraitist that is used to read input. 9 00:01:11,000 --> 00:01:20,870 So instead of having one register which is sport to read and write to output we have flat to write two 10 00:01:20,870 --> 00:01:26,140 output and port to read from input. 11 00:01:26,150 --> 00:01:37,720 So as you can see this is one of the main differences between pick 16 F and big 18 F and pick 16. 12 00:01:37,750 --> 00:01:46,820 If we only have these two registers Tereus and bought. 13 00:01:47,200 --> 00:01:51,630 This is used to assign a certain been in part B. 14 00:01:51,740 --> 00:01:55,640 This board as in both or out. 15 00:01:55,640 --> 00:02:01,490 So in this example if we want to apply this to to pick 16 f 16 00:02:04,420 --> 00:02:16,060 we can see that one means zero output so input output output output output output output and input Borst 17 00:02:16,300 --> 00:02:24,180 of port is used here to send a value or read a value in a certain pin. 18 00:02:24,190 --> 00:02:31,730 So in this case port will send a value to each person that's assigned as out of. 19 00:02:31,840 --> 00:02:37,600 So these pins are all output. 20 00:02:37,700 --> 00:02:46,160 So the value written here will be sent to the port P as output. 21 00:02:46,550 --> 00:02:53,210 And these two bins will use will be used to read input because they have ones in that first register 22 00:02:54,590 --> 00:02:59,680 and we can read the input using this register which sport. 23 00:03:00,710 --> 00:03:09,310 And this was a very good approach at the beginning but it started to have problems while programming. 24 00:03:09,680 --> 00:03:15,360 And one of the most common problems is that it modify the right problem. 25 00:03:15,440 --> 00:03:16,820 We have a lecture on that. 26 00:03:16,850 --> 00:03:25,210 You can check the section that has the name of read modify life problem to identify you know and don't. 27 00:03:25,430 --> 00:03:29,950 Why pick 18 is better than pick 16. 28 00:03:29,960 --> 00:03:45,850 So now as you can see this is the internal structure for controlling the port and pick it up. 29 00:03:45,860 --> 00:03:52,520 Now we have that research which is the same to assign certain been as input or output but in a city 30 00:03:52,550 --> 00:03:53,330 the fun is just that. 31 00:03:53,330 --> 00:03:58,170 Now we have two registers support thunder. 32 00:03:58,910 --> 00:04:02,560 So port is used to read about 33 00:04:07,610 --> 00:04:10,740 why a lot is used to send out. 34 00:04:11,450 --> 00:04:17,750 So if you want to turn on LEDs on port P. You have to send the values in. 35 00:04:17,750 --> 00:04:21,580 This is just stuff like that. 36 00:04:21,590 --> 00:04:22,640 Pick 60. 37 00:04:22,650 --> 00:04:24,050 And if you are familiar with it. 38 00:04:24,050 --> 00:04:32,780 So now we'll explain in the next lesson how to send and receive data and we'll have also a practical 39 00:04:32,780 --> 00:04:37,800 example but for now you need just in all that and pick it up. 40 00:04:37,880 --> 00:04:46,880 We have three registers one for input output just like and pick 16 and 2 for sending and receiving values 41 00:04:47,300 --> 00:04:51,020 unlike pick 16 which has only one which is paused. 42 00:04:51,020 --> 00:04:59,080 Now we have flat for the output and pool for and but for pick it enough. 43 00:04:59,160 --> 00:05:04,160 Now let's move on logic high one here. 44 00:05:04,430 --> 00:05:11,990 As I mentioned earlier that addresses just what makes corresponding pin of PIC microcontroller in boat 45 00:05:12,090 --> 00:05:15,600 y logic low zero at register. 46 00:05:15,800 --> 00:05:16,330 This one 47 00:05:19,260 --> 00:05:29,670 makes corresponding pin out when a pin is configured as in but it will be in high M.B.A. state and its 48 00:05:29,670 --> 00:05:35,700 physical state voltage level can be read using port registers. 49 00:05:36,390 --> 00:05:40,530 So this one is going to be used for reading but 50 00:05:44,820 --> 00:05:51,420 when a pin is configured as output its output logic that will be determined by law to register which 51 00:05:51,420 --> 00:05:53,040 is this one. 52 00:05:53,550 --> 00:06:02,650 This is then you'll think and pick it up one lot of stuff makes a corresponding pin logic high or the 53 00:06:03,690 --> 00:06:09,910 and zero letters just to make a corresponding pin logic low or as us. 54 00:06:09,930 --> 00:06:15,130 So as you can see here we have these values. 55 00:06:16,080 --> 00:06:25,320 So one high zero low latitude just hobbit's corresponding to input pins have no effect on output or 56 00:06:25,380 --> 00:06:27,530 input thoughts. 57 00:06:27,540 --> 00:06:29,280 They are don't care. 58 00:06:29,670 --> 00:06:34,230 As you can see here we have this pen which is don't care and disk bin which is don't care 59 00:06:37,760 --> 00:06:41,300 following points should be noted. 60 00:06:41,750 --> 00:06:49,000 The first point to be noted is that laterite operationalized slat register lat read operation leads 61 00:06:49,270 --> 00:06:58,040 to just touch port flight operation bright light registers port read operation reads. 62 00:06:58,070 --> 00:07:07,730 The physical state or voltage level of all the bands Tharsis you can write outputs using port right 63 00:07:07,820 --> 00:07:10,130 or left or right operation. 64 00:07:10,130 --> 00:07:21,260 But using port like operation is not recommended because it will cause read modify write problem which 65 00:07:21,260 --> 00:07:23,130 we did mentioned earlier. 66 00:07:23,480 --> 00:07:30,190 So it's important to keep in mind that using ptrace port and that must be done with. 67 00:07:30,920 --> 00:07:43,620 Please precise steps so that you can identify what is used for writing what it is used for reading and 68 00:07:43,620 --> 00:07:52,480 what is used for assigning a search term pain as input or output. 69 00:07:52,890 --> 00:07:56,100 That's it for this lesson. 70 00:07:56,100 --> 00:08:02,050 To summarize things we already mentioned that in pick 16. 71 00:08:02,070 --> 00:08:13,800 If we have parsed and trace trace is used for assigning pins as input and output port is used to read 72 00:08:13,800 --> 00:08:17,930 data from pins drive that opens 73 00:08:20,570 --> 00:08:22,850 wine and pick it. 74 00:08:23,240 --> 00:08:25,530 We have three registers. 75 00:08:25,530 --> 00:08:35,330 Trace is used for the very same thing that it was used for and pick 16 which is assigning a board pin 76 00:08:35,880 --> 00:08:40,130 input or out. 77 00:08:40,130 --> 00:08:50,070 The main difference here is that we have a new stuff called Latt that port stuff can be used for reading. 78 00:08:50,170 --> 00:08:54,070 But why not register. 79 00:08:54,390 --> 00:08:59,880 Must be used for writing out. 80 00:09:00,110 --> 00:09:01,860 That's it for this reason. 81 00:09:01,910 --> 00:09:11,600 If you have any question please ask on and I'm here to help you. 82 00:09:11,600 --> 00:09:12,630 Thanks for watching. 83 00:09:12,740 --> 00:09:16,050 And please don't forget to review this course. 84 00:09:16,190 --> 00:09:19,550 Next we will go in a more practical approach. 85 00:09:19,580 --> 00:09:28,330 We'll discuss a code and write it to configure Septem pens so that we can make that idea more clear. 86 00:09:29,090 --> 00:09:30,740 Thanks for watching this lesson. 87 00:09:30,740 --> 00:09:31,880 See you next. 88 00:09:31,880 --> 00:09:34,000 This is educational engineering team.