 Hello and welcome to this video session on peak microcontroller 16F877A hardware interfacing. We will try to understand different hardware interfacing, its simulation basically through a software called as peak sim lab. These are the learning outcomes of this video session so at the end student will be able to demonstrate the operation and effectiveness of the virtual simulation for the peak microcontroller. Student will be able to implement the steps for virtual simulation using this peak sim lab software and student will be able to interface different peripherals like LED, push button, switches, LCD, motor, keypad, e-sphere problem IC, relay, etc. So these are the contents of this presentation. So first we will have brief introduction about the peak sim lab then we will go for this what are the steps we need to follow when you are using that peak sim lab then we will have demonstration of different peripherals using one sample demo program available and then we will go for how we can have interfacing of different spare parts, peripherals like LED, push button, switches, LCD, motor, etc. So now let us move to the software peak sim lab. So when it is installed on your computer so you will get a shortcut created on your desktop. So this is the front end you get for the peak sim lab. So here this is a virtual board available only thing is first you have to choose when first time it is installed you have to choose this peak genius board then it will ask which microcontroller you want on that particular board. So we will go for selecting this peak 16F877A microcontroller so you select that and then this board is ready for virtual simulation. Let us go through what different blocks, what different hardware are available on this particular board for the simulation. Heard of this particular board is this peak microcontroller IC. So as we have selected 16F877A microcontroller so that microcontroller is simulated here along with this you will find this supports serial communication. So serial communication interface IC max 232 is available here then you can have that serial bus connectivity then you have got this there are two relays available two relays can be connected to two different port pins you have DS1307 so DS1307 is serial RTC IC real time clock IC. Along with that here you find 24C04 24C04 is a E square prom IC with the memory capacity of 4 kilobits so this 04 indicates 4 kilobits along with this you find different switches push buttons are there here you get buzzer so to observe the performance of the PWM type of programs there is one fan available here one 16 by 2 LCD is available there are four displays available seven segment displays available connected in dynamic mode four by three keypad is available then LEDs are connected LEDs are available for you this is one reset button regulated power supply buzzer you get here so this is how different components are available on this particular board all these are interface to this particular microcontroller and then we can write a program through MPLAB XID and program may be written in assembly language or see ultimately it can give you a hex file and what is requirement from this particular software is you have to load the hex file for the task which you want to perform you create the hex file and load that hex file and while writing a program for interfacing of these peripherals you have to understand the interfacing means this LCD is there so where exactly this LCD is connected to which port this LCD is connected this fan where it is connected relays where where they are connected so that interfacing diagram is available in the user manual of this particular board and there you will find all these connections interconnections now let us try to understand what steps you need to follow when you are using this particular software so as I said first select the board peak genius then for that particular board select the microcontroller will go for peak 16f 877 a as microcontroller and once the microcontroller is selected it is expected that already you have the hex file for your program so you have written program may be in assembly language or see and then you are using mplab you have created hex file for it so just you have to load that particular hex file you have to give the path for the hex file and once you load that particular hex file that hex file will be running by this particular microcontroller so this one reset just you apply reset power non reset is also there you apply reset is the power button available apply reset and then your program will get executed now to understand working of these different peripherals one sample program is available here which demonstrates the interfacing and outputs possible with these different interfacings now let us try to understand these different interfacings how they may work so let us go for loading that particular program so one example program is there so this is a test program I load that test program so now it is first so just if you apply reset so this is how it works it is expecting the key press for the push button RB 1 so if I press that RB 1 so first subroutine is written for testing LCD so those 16 by 2 LCD is interface we need to test all the segments are working properly or not so all cursor movements are occurring properly or not so it is written one program is written to display all the special characters all the digits all alphabets in capital letters as well as small letters so whether they are getting displayed properly or not so this is one test program for the LCD so where you can test whether all the segments of your LCD are working properly all the functions of the LCD are working properly or not so one buzzer is there now it has started testing of the seven segment display so it is testing display one all the characters are getting checked all the segments are getting checked whether you can display all the digits all hex values a b c d e f fine so this is how you can make the use of this seven segment display now it is waiting for the key press RB 1 so LEDs are getting tested so sequentially all the LEDs are turned on so LED test is fine then so again all the keys which are connected to the port b are getting tested so just press RB 1 fine RB 1 is okay RB 2 RB 2 is okay like that continue RB 3 RB 4 RB 5 okay so all these connections are okay now you can go for testing for the serial communication where the serial communication module is working or not so because of timing constraint we will skip this particular part so for skipping if you don't want to have that serial communication test press RB 1 now it has started ADC program so ADC port 1 is connected so just you can vary the port location and its conversion this will change the analog voltage which is getting applied and then automatically its conversion will get changed so P2 connected so that also you can test so as per the port input so voltage which is getting displayed which is rather output of ADC so now relays are getting tested so relay 1 and relay 2 both the relays are getting tested just make that port pin high you will get that relays turn on now if it is a temperature sensor so we have got that LM 35 on the board virtual LM 35 so it will be displaying you the temperature so just go on changing the port position so you will get that the temperature gets changed and as temperature crosses a particular threshold value you'll find that a program is written if temperature crosses a threshold value it should turn on this particular fan so this is how the ADC interfacing virtual input applied to that ADC through the port or through the temperature sensor and then it is controlling the action of the fan when the temperature crosses a particular threshold value so automatically the fan is getting turned on so now this RTC is there relay time clock so it is showing that date today's date as well as current time is getting displayed here so as such it is showing the system time but when it's a real RTC interface to the microcontroller it will be displaying you the time value which is loaded in that particular RTC let us try to understand how to have your peripherals means if you want to have some different peripherals to be connected so how to do that so for that what you have to do is you have to go to the module and click on spare parts so when you click on spare parts you have to select the spare part which you want to add let us say I want to add certain switches or I want to add a push button so just if I want to add push button click on that so these are the push buttons available but now you have to decide where those push buttons will get exactly connected so just right click on that and go to the properties and then where you want that particular push button number one should get connected so you have to select the port pin of the microcontroller where you want to connect that so like this you can have connectivity of this particular peripheral to the microcontroller so like this you can have addition of RGB LED switches LEDs you can add LCD also you can be connected so these are the spare parts as per your requirement you can add here and then once that spare part is added so you have to click on the right click right click and set the properties as per your interfacing requirements select these options and then accordingly write the program and you will get the output for that particular program now let us try to understand how I can have your program I have one demo program so I load the hex file for that so let us check what is the output what output we get for that particular program so PWM program is written so with for certain duty cycle that program is written so just load that hex file the instant you load that hex file so that PWM program will so these are the references used for this presentation thank you