 So today we will look at hands-on experience on T1 Launchpad. So we will start from installing code composer studio which is IDE for T1 Launchpad and then how to write program in that CCS, how to import different libraries and different support files to run this program successfully. How to build the program and debug it into the microcontroller board. So yes we will start from installing this CCS. So you all are provided with this PDF file, this workshop PDF file and it is self-explanatory about somehow the basics of the T1 and installation also as well as there are some basic programs you can look at. So yes we will start from this chapter 1 which is particularly hardware and software requirement for this T1. So here in this chapter you can see this is the information about the T1 peripherals and how this launchpad works and yes this lab 1 hardware and software setup. So we will directly go to the software. So yes at this page you will get this link, this is the link for downloading the CCS software. So you can directly click on this link and we will go to this site which is having this CCS software. Yes so this software is available for Linux users as well as Mac OS users and as well as Windows users. According to your configuration of your system you can download whichever is preferred for your machine. So my machine is Windows 10 and it is 64 so I am going to download this one. So it will take some time because it is having, so I have already downloaded it, you can see here. So I am not going to download it again. So once you download it you can go to this downloads and from here you can unzip the file and same folder I am unzipping it, yes unzipping is completed and we can go to the downloads again, where hardware, so this is the folder and ok so you have to directly install this and you can run this, yes and when installing you can take care of some things like you can see in this pdf file only that you can accept this license agreement then next then you have to select one folder and you have to change the actually main installation folder to the c-ti file and after this like I will tell also. So first of all next then we are going to accept the agreement then next, then operating is ok, this is ok, so next ok then installation directory, next validating installation directory. So full installation is actually not needed because it will consume lot of space. So particularly we are only going to use a tivac launchpad and so we can go for custom installation and we will install only the required files that are required for our tivac launchpad. So yes, so here you have to click on first of all this tm4c is our configuration this tm4c123. So this should be checked and emsp also in because some libraries support this emsp, so you have to check this also and this is at least recommended for example you can see that here also after this emsp and tivac it should be checked and then we can go next so it is loading. So here spectrum digital debug program boards is ok, blackhawk is not required for our device. You can see this also in this here that we have to in this debug section this blackhawk is not required so yes we will continue with this sake that blackhawk is not required. In order the following debug program boards are not supported so these boards will not be supported because we have not checked this blackhawk and basically we are not going to use this. Our is tm4c123 or tivac series so it is ok for us and now setup is now ready to begin installing yes next so this is now installing just for this I will say because this is window for ccs5 this pdf is during ccs5 so this type of debug section may be there in previous versions. So for now you will take care that you are not checking this blackhawk because it is not required that is it other issue because you can here also see that uncheck this blackhawk in spectrum digital unless you are planning to use this so we are not planning to use this so we are not requiring this so it will take some time now for installing yes so installation is completed now create a short cut yes now it is now I think created yes this is code number should have it is now installed. Now let us move to another part now this is software is installed but for running the program we will need some driver files and support files and that are that can be obtained from here this is a tivaware library so this is file name and from here we can get this otherwise you are also provided with this installation guide here also all these links are mentioned and this is this tirtios library if I am similar to this one so we will put this now here in downloads we are downloading it for our offline kind of thing this ccs we are going to operate offline mode so there is another ccs cloud is also for that we can download this one for now we are going to download this tivaware for c series software complete so download options and here you can also see this is one two three four one two three four one two nine ours is one two three jxl and this four this is the full release for now we can download this full release because after some time we can move for this one two nine if you wanted like that so here you can provide your email id so you can create your account by putting your institute name and all these things like this is your institute name country name like this and so we are going to use this as far as ccs we can say and I said if I want this yes we are not going we are going to use this for our we can say as a student version so now we can download this download it from here so yes we can download this but I think I have downloaded this even before so I can download this so yes this is now downloaded so we have to download it and now install it in this particular folder so see and pl we can go to this downloads and from here we have to install this one this is a tivaware installation files so this is ok no issue next and install ok so this installation is completed now finished ok so you can go here see this ti and here this is the tivaware which is containing all this you can go this you can see all this driver files and this particular is our ccs installation software ok so this is the installation procedure basically now we will look at how to like write the program in this ccs and build this program so open this you can give any name or any location as per your comfort like you can go give me any day or year also now for now I will keep it as it is and launch so basically this is workspace and every time you will start this ccs it will start it will give you a last workspace name and in one workspace you can create a number of projects there is no limit but if you are using like planning different applications and you are planning different workspace for different applications so you can give different workspace or different types of programs ok so this is open so this window will be there when you will open the ccs for the first time yeah you can go to this videos if you want or this user's guide and things like this so for now I am going to close this and now we will start and we will write one of the programless simple editing program so we will find a new ccs project and here you need to this set this target whatever the device you are using about that you have to see this so currently we are using a tvac series and in that tvac series tm4c123 gh6 p.m so whatever link we have provided you for the purchase that one is this tm4c123 gh6 p.m this one and connection is stereo in circuit db interface so if you by chance miss this mistake or by chance you will you are going to do any mistake in this step then even problem will not be successful so take care whenever you are starting to take care of you feel this or select this accurate so now I will give this as a ccs trial one so empty project need main.c and finish oh yes so in project explorer you can see your project so if we you can see under this project there is this is a tm4c123 gh6 p.m.c and then standard file these two files are already get added because we have selected this our device in previous section only so again this target configuration so it is easier it is now a program can be built so that this is essential now here we can we have to add library files we have to add different variables that we are going to use in this program and this in main.wide that's main function we can write our program basically so for now because it is first program I am going to give you just glimpses of how to build the program how to run it successfully on this active launchpad so we will directly copy paste one of the program for from this particular launchpad workshop which is provided for it to be given also so I think this is lab 3 lab 3 new so this is initialization of initialization and GPIO this is the objective of this and you can link the video on this t1 launchpad so okay so this is the complete program for for this I will touch the copy paste this program for now and later we will discuss whole thing about these also so okay so basically I will just for better initialization I will do this okay if this is in this condition and else do this so these are the driver files basically which are required to run this program so in this program in this particular program we are going to only use GPIO pins that is generally input general purpose input output pins but when we going to use PWM or we can say QBI pins then we need to add according to these drive only files so many many more driver as will be there as per required in our program so basically this is only simple program which are on board it is going to stay available only now I just I will show you so this is build button so what will it does when we press build it will change the program scoring or not and then if we are getting the message of build finished then our program is completely okay otherwise there will be some something missing in this program and once our build is okay like build finished with 100% accuracy then we can go for this debug so basically debug what does this debug will download the program into our microcontroller board or main drive of the microcontroller this is that is tba so basically I am having this tba with me this is tba C123 or dm core C123 and I am now connecting this to the this tba so basically I am connecting that up with the tba now let us go for direct building so we can you can get some error and we will solve the error so build so what the error it is giving for now he cannot open source file i n c h w memapp.lh so it is not opening this file why because we have not given the path for these driver files where are these driver files so we need to provide this path so how to resolve this error there are two ways I will discuss both of the ways first of all I will give one simple way that is we have to right click on this project name in this project go to properties in properties go to this am compiler and include options so here we have to add directly browse we will here add directory of this our tba installation or tba way instruction we will add this path so it will it will take whatever files or whatever libraries required in this program it will automatically so taken from this file or this library so this is the folder we are going to select this folder so this is directly okay and again in ar linker find search path go to add and here also browse one and here we are only providing particularly the driverly file so we see only ti tba where driverly in this way so we will go to ccs deeper and this driverly.lib so this file we will link with this particular project so apply and close now we will go to build it again yes so build is finished without any error so here there is no any error and build is finished now so you can also observe one thing the the the color of this sys clock cpl clock set or sys like we can say system called peripheral enable gpi open type input output like that so these are the functions so basically these functions are we can call it as a api functions so now this color of this is api function is is now changed it is because it is now these files are now connected or we can say they are linked now so this color is changed and our program is now okay or error free so we can now go for downloading that program on the our microcontroller board now just i will explain this program with just quickly so these are nothing but driver files which are required for c programming this is htdi integer like int.h and boolean algebra for boolean algebra this is htd boole.h so this is for pin mapping of this tba microcontroller in types of pin then this is for system control like for hardware configuration and this is for gpi oh like we are going to use general purpose input output pins and so these driver files should be added and this is a integer u in 8.8 it is we can say is a 8-bit integer we can we can have 16-bit or 32-bit integer uh so we have given initial value of 2 now system control clock said what it is it does it it says our clock like the tba clock or microcontroller clock to some frequency so here it is giving 40 megahertz frequency you can see how it is 40 megahertz and all these things in here in this lab file also that this system clock is uh you can see this is 16 megahertz the crystal and which crystal drives the 400 megahertz PLL so now we have divided it by the system divider divider we have applied divider of 5 so 400 divided by 5 it is 80 megahertz and there will be one default divider of 2 you can see here so because of that our system clock is now 40 megahertz now we have we have enabled peripheral f because the on-board LEDs which are there on tba microcontroller board they are connected to the pf like ef port basically so pf1 pf2 and pf3 pf1 is red LED pf2 is blue and pf3 is green LED so basically we have enabled this port f and then as we are going to give signal to this LEDs so this is we have configured at this pins as a gpi output so pf1 pf2 pf3 pins are configured as general purpose input output main output so why loop is continuous of forever loop we can say so it will run forever after this three lines and so here gpi open write port f 1 2 and 3 and here we can first of at first we will get 2 so there will be one pin masking concept we are going to share 2 3 sample programs with you so in that I have already explained with all these things of pin masking so basically this 2 will be converted in binary this will be 1 0 and this port f is having 8 registers 8 registers and so for example if we see this 8 register as a 0 0 0 0 so 8 times so 1 0 will enable pin 1 I will give you one one example simple example like port f means having 8 registers for 8 pins and so in binary we can write these at a port here as a 0 0 0 0 0 0 0 0 initial value we can say so when we are going to give it a value of 2 so initial value is 2 so when we give it 2 so in binary it will convert to the 0 0 0 0 0 0 1 0 so from this this one will this one will be corresponding to pf0 export f pin 0 like that pf1 pf2 pf3 pf2 the pf7 so 1 0 will will make LED red on okay it will be for this much delay this delay is also given in terms of loops of cycles not in clock cycles but it is loop and one loop is equal to three clock cycles so basically for one second delay we can have a clock cycle divided by three like that this value will be clock cycle divided by three for one second after this delay it is now doing 0 0 giving this 0 to the port f so 0 will now make all the LEDs off now there will be again delay of this time and then if it is the pin is 8 this this particular variable is 8 then make it as a 2 otherwise multiply it by 2 so first of all at first it is 2 so 2 by 2 into 2 4 so again in another so next time it will give value of 4 and 4 will be like 1 0 0 so it will make a blue LED on after that again it will multiply by 2 so 8 so 1 0 0 0 it will make green LED on like that once it make once it is 8 then it will again go to the 2 value so in this way we will this red blue and green LED will be blinking one after another one after another continuously so now we will debug this particular program to this TVA so okay so build finished and now it will be downloaded here you can also see here also it is 100% downloaded but it is still in some time now yes when it is available on our launchpad then here you can see there will be a resume button and there will be one stop or terminate button now our launchpad is not showing anything now because once we will resume this then only the program will be run on this launchpad so now I could do resume it then you can see that red blue green red blue green red green like that so yeah so this is this is what the program is now if you want to you can try your sip and play with it and with different LEDs and for different delays like that you can do but for now I will show you another when very interesting we can say facility provided by the CCS we can we can at a real time we can observe these variables the values taken by variables for example here in this program we are having this UI 8 pin data variable so select it right click on it then add to watch expression so once you add to watch expression here you can see it is added and now we have to click on continuous refresh so that it will continuously change its value like in a real time so you can see 2842 if we uncheck this continuous refresh then it will remain as it is and as we press this continuous refresh then it will continuously give us a real time moment of this variable so it is actually very important in terms of when we are going to capture this encoder data from motor for capturing the position and speed of the motor also like in any variables that are changing in our program and we are going to use that in anything or to plot graph or do something in that case this facility is very important so also you can see this we can increase this or in other words decrease this continuous refresh interval to be 100 milliseconds maybe I think 100 is the minimum you can see this value must be at least 100 milliseconds 100 millisecond so apply and close so it will change in 100 milliseconds so now you can see that this is 248, 248, 248 like that otherwise if this continuous refresh interval is more than our delay then it will actually drop some of the values like for 500 you can see for 500 it will directly throw so it is 2284 which is wrong actually it should go from like 248, 248 so it is why why it is wrong so because this continuous refresh time or interval is more than the system delay which we have provided in the program so we can give it as a 100 millisecond and now it will show us the 248, 248 which is the actual values of this register also we can plot this in ccs only like right click on this then go to the graph and this graph and here also we have to give as a enable continuous refresh you can see this is 2 then it is 8, 248, 248, 248 like that so yes so why it is important so because whenever you are using or you are requiring any input from the micro controller like any signal or any input data from sensor like an encoder then we need these graphs and this data so this data can also be exported in a you can say excel file also by using this like right click on this then data and export call so for this we have to browse one excel file which that should be there in our laptop any file we can provide and it can directly give you it it will it will export all the data which is there here in this visible region so for this also we can increase or decrease the send build time according to your requirement of the data so you require large number of samples or less number of samples are also okay for you accordingly you can change this sample so this from graph properties display data size is there so currently it is giving us 200 sample points so here we can change this to anything as required by you and you can export the data so I can resume it again so it will again start change so I will pause it will again pause I will I can resume it it will again like that so you can pause the program also however when you are going to terminate it is not going to stop after terminating you are actually terminating this window this debug window this graph and this thing these things but your program will be running there on microcontroller so I have now stopped this or terminated this and so this debug window is gone but still my program is running on the microcontroller so okay