Arduino Lilypad Library for Proteus

Hello friends, few day ago I have posted a tutorial on how to do Arduino Simulation in Proteus. In that post, we have used an Arduino Library for Proteus but as this library is in its initial phases that's why currently it supports only three basic Arduino boards which are Arduino UNO, Arduino Mega2560 and Arduino Mega1280. But as we know there are numerous Arduino boards which are used these days. So, I searched a little and I came across this amazing Arduino Lilypad Library for Proteus which has the support for few other arduino boards, so I thought to share it with you guys. I have tested this library myself as always and its 100% working. I have tested it on Proteus 7 and I think it will work fine on Proteus 8 as well. As we have the support for above three boards in the previous library so the two new boards here are Arduino Lilypad and Arduino Nano, both of them are quite used these days. I have explained it in detail, step by step below, if you still feel problem in any step then ask in comments.This library has the support for following boards:

  • Arduino UNO
  • Arduino UNO SMD
  • Arduino Mega
  • Arduino Nano
  • Arduino Lilypad
Note:
  • This library isn't designed by our team so all credit goes to its creator, who is blogembarcado. Hats off dude !!!
  • We are just spreading the knowledge so that more and more engineers could get benefit out of it.
  • I have also posted Ultrasonic Sensor Library for Proteus, which you can download, using this library you can simulate Ultrasonic Sensor in Proteus, moreover you can also download different examples on Ultrasonic Sensor Simulation in Proteus to get a complete grip on this sensor.

Arduino Lilypad Library for Proteus

  • First of all, download this new Arduino Lilypad Library for Proteus by clicking on the button below:
Arduino Lilypad Library for Proteus
  • Once you downloaded the rar file, extract the file named as "BLOGEMBARCADO.LIB".
  • Now place this file in the library folder of Proteus, which, in my case, is "C:\Program Files (x86)\Labcenter Electronics\Proteus 7 Professional\LIBRARY". I hope it will give you the idea where to place the file.
  • After placing the file in this folder, now open the Proteus ISIS and click on the component selection button.
  • In the search box write "Arduino" and the list of all the arduino boards will be shown immediately as shown in the below figure:
  • You can see all the five boards in the above figure and you can select any of them.There's also another components in the list which is ultrasonic sensor. Yes, this library also supports ultrasonic sensor but I haven't tested it yet that's why didn't mentioned it, I will test this sensor soon and then will also explain its working.
  • Now you can select any of these boards and can start working on them rite away. All the five boards are shown in the below figure:
  • The two new Arduino boards in this library are shown below:
  • So, now simply design your circuit and write the code in the Arduino ide. After writing the code, get the hex file from arduino software and upload it to these boards.
Note:
  • In order to upload the hex file simply double click it and the properties window will pop up. In the Properties window, there will be an option named Program File. In this Program File, browse for the hex file and upload it.
  • Now run your Proteus simulation and it will work like charm.
  • I will post few projects on these boards soon as soon as I get time to write them, so stay tuned and have fun.
  • I have posted a small project on how to use Arduino Lilypad in Proteus which you can read and download from Arduino Lilypad Simulation in Proteus.

How to Control Relay in Proteus ISIS

Hello friends, hope you all are fine and having fun. In the previous posts, we have discussed DC motor Control in Proteus ISIS and after that we have discussed the Stepper Motor Control in Proteus ISIS and finally we had a look at Servo Motor Control in Proteus ISIS. Now when you talk about motors control then first thing came in mind is Relay, because relay is the best way of controlling any motor. In today's post, we are gonna have a look at How to Control Relay in Proteus ISIS. Relay is a key components of any electronics or electrical circuit and is usually a problem for the engineers and students. Although, its not as difficult as it seems so I thought to post about it.

In today's post, we will first simulate the Relay in a simple circuit in which when you run the simulation, the relay will automatically got activated and after that we will go in a bit detail and will control relay using a logic, i.e. when you provide +5V to it then the relay will go activated and when you give GNd then it will de-energize. I will explain it below in detail how to use it with Microcontroller. Moreover, if you are planning to work on Relay then you should also check What is a Relay and How to use it? and should also have a look at Relay Interfacing with Microcontroller using ULN2003 and finally must check this one as well Relay Control using 555 timer in Proteus ISIS.If you have any questions. related to it then ask in comments and I will try my best to reply your queries. Let's get started with designing of control relay in Proteus ISIS.

Simple Control Relay Circuit in Proteus ISIS

  • First of all, we are gonna simulate a simple control relay circuit in which we will manually turn on or off the relay.
  • Open Proteus ISIS and select the below components, as shown in below figure, from the components library of Proteus, if you don't know how to do it then check our earlier posts on Proteus.
  • Now, design a circuit as shown in below figure:
  • The circuit is self explanatory, first we have used a simple 12V battery to power up the simulation, after that there's a small led attached, which will indicate that whether proper power is supplied to the system or not. Next is our relay, which is named as RL1 in the above figure.
  • After the relay, we have placed a simple 12V lamp, so now when the relay will be energized, this lamp will glow up and when the relay is de-energized, the lamp will remain off. As in the above figure, the simulation is off, that's why the lamp isn't glowing.
  • After designing the circuit, now click on the run button and if everything goes fine, then the lamp will glow as shown in below figure:
  • So, now you can see the small led is also ON, I have used green that's why its showing green color indicating that power supply is working.
  • If you compare the off state and on state simulation then you will see that the Relay is now connected with second terminal and thus completing the circuit for lamp and lamp is also now glowing.

Complex Relay simulation in Proteus ISIS

  • Now, we are gonna design a bit more complex control  relay simulation in Proteus ISIS, it's not much complicated but needs a bit more care while simulating.
  • In previous section, we have seen a simple circuit which is operated manually means in order to turn it on or off you have to turn on or off the power supply but normally, it is required that the relay must be controlled by some microcontroller automatically.
  • As the microcontrollers normally work on 5V so in order to control a 12V relay using 5V microcontroller, we need to use transistor. In that case, when you give +5V the relay got actuated and when you give GND then relay get turned off.
  • So, first of all get these components from the Arduino components library.
  • Now, design the circuit as shown in the below figure:
  • As this tutorial is about relays so I haven't used microcontroller here, instead I used this logic state, it will work same as microcontroller. So the above circuit is quite similar to the simple circuit we have seen in the above section. The only difference here is the NPN transistor.
  • Now, we are not providing the supply directly to the relay, instead we are providing it via this transistor. So, when the logid state is zero means ground, the transistor won't work and the supply cant reached to the relay and when we make the logic 1 means +5V on the base of transostor, then the relay circuit will complete and the relay will be energized.
  • Now run the simulation, the off state is shown below:
  • In the above figure, you can see that the led goes on because the power is supplied to the circuit but the lamp is still OFF and the relay is also not energized because the logic state is a low level i.e. 0.
  • Now click on the logic state to make it on high level i.e. +5V, the on state is shown in below figure:
  • Now you can see that as we make the logic state high, now relay got connected and the lamp is also ON. So by comparing both ON and OFF states, you can easily get the idea how the relay is operating.
Note:
  • If you are planning on using the relay with microcontroller, then simply remove this logic state and connect the base of transistor with the output pin of microcontroller and when you low the microcontroller pin relay will get de energized and and when you make the pin high, it will get energized.
    • That's all for today, hope you have got something out of it. In the next post I will show how to simulate a DC motor using relay. Till then take care. :))

Microcontroller Programming Services

The Engineering Projects (TEP) deals in all kinds of programming and embedded projects related to microcontroller. Microcontroller Programming Services provided by TEP has no limits. If you have any project related to programming of microcontrollers, then sit back, relax and let us do the job for you. Microcontroller programming Services provided by TEP has a very broad field as there are lot of boards available in market. Our operator is available 24 / 7 and if someone wants to discuss their project then he/she can talk to us live via our support chat room or can also send us email.

Microcontrollers Programming is difficult because usually engineers and students doesn’t have the required tools for debugging of their codes and electronic circuits, that the main reason, they got into trouble while designing projects. On the other hand, we are highly equipped withh all sorts of tools to deal with such problems and we not only design projects but also put our full effort in explaining these projects to engineers and students so that they also get technical knowledge and can easily debug or increase the projects’ technicality in future.

Microcontrollers Programming Services

We provide services for many different Microcontrollers as we have experienced engineers for Microcontroller programming purposes. Programming Languages, we used for programming these microcontrollers are assembly language, C programming language etc. Few of the microcontrollers on which, we have worked are:
  • Arduino
  • PIC
  • Atmel
  • Raspberry Pi
  • FPGa
  • MBed
  • LPC etc.

Note:

  • If you are unable to find your Microcontroller, then no need to get panic, contact us and we will provide you solution.

Technologies – We have Worked on

We have designed projects in almost every field. Embedded projects belong to different fields and if you are not master of all trades then you can’t complete in embedded fields. That’s the main reason, we have a batch of engineers in our research depart who continuously work on research new fields. We have worked on many different technologies taking from simple keypad, LCD to high complex modules such as WiFi, Ethernet etc. We have worked on many different technologies, such as:

  • RS232
  • Ethernet
  • Wifi
  • Radio Frequency (RF)
  • Bluetooth
  • RFID
  • & many more.

Motors Operated

In embedded projects, motors are normally used, especially in robotics. Without motors, its unable to drive robots. We have worked on many different motors, such as:

  • DC Motors
  • Stepper Motors
  • Servo Motors

Apart from these motors, few motors are used in electrical projects for controlling purposes, such as:

  • Induction motors.
  • Synchronous motors.
  • Squirrel Cage motors.

Projects – We have done in Past

We have designed complete systems for different clients all over the world. Few of them are given below. These are not all, but just a reflection of our work. Apart from these projects, we have also worked on many different fields as well.  
  • Man Following Robot
  • IR based Traffic Control System
  • Wifi based industrial automation
  • Maze Solving Robot
  • Quadcopter
  • Water Level Indicator
  • 3D Notice Board using LED Cube
  • Anti Theft Alarm for Bikes
  • Industrial Automation Ethernet
  • Home Automation System (RF based, Wifi based, Zigbee based, GSM based)
  • M4 Driving Card for textile industry. (8 bit, 16 bit, 32 bit, 64 bit)
  • Hotel Management System via Mesh Networking
  • Navigation Robot Using GPS Control.
So, these are all the Microcontroller Programming Services which are provided by TEP. If you have any trouble then Contact Us and we will try our best to resolve your issues.

Getting Data From Webserver using Arduino Wifi

In today’s post, as the name suggests, we will see how to get data from online webserver using Arduino Wifi in simple steps. Getting data from web server using Arduino Wifi Shield has always remained a problem for the engineers. Its not much difficult task as its usually considered to be. In today’s post, I will create a small project in which I will control two simple LEDs via online web server. It’s really a very interesting project and when I completed it, I felt like Hurrah!!!

Arduino Wifi Shield is used to connect Arduino board with Wifi. After connectivity with Wifi, one can perform many tasks using this shield. We can built a complete server on it and can also use it as a client. Server designed on an Arduino Wifi Shield are usually quite simple as it doesn’t have much processing power to support heavy server. Arduino Wifi Shield is mostly used in home automation projects where home appliances are controlled by Wifi or can also be used for security purposes. In short, it has numerous applications and is widely used.

In today’s project, we will use Arduino UNO board for programming purposes, and will interface two leds with it and then we will control these leds via an online web server. Using that online web server, we will ON and OFF these leds on command. For controlling leds from an online server, we have to design two things:

  • Online Web Server.
  • Arduino Web Client.
Note:
  • The complete project has been sent to all the subscribed members. If you want this project code, then Subscribe to our mailing list, and it will be automatically emailed to you as well.

Project Description

First of all, I will explain what we are doing and what we want to achieve. In hardware, we will use:
  • Arduino UNO
  • Arduino Wifi Shield
  • LEDs x 2
  • 10k ohm x 2

Their arrangement and pin configuration is shown in the Arduino Web Client section. We will arrange them in such a way that two leds will be mounted on the Arduino UNO shield. In web server, we will design a simple page, which will be having four buttons on it, which will be:

  • LED 1 ON
  • LED 1 OFF
  • LED 2 ON
  • LED 2 OFF

When someone will open this web page and will pres any of these buttons, respective task will be performed on the Leds. i.e. if someone pressed the LED 1 ON button then Led 1 present on the Arduino board will get ON and when someone press LED 1 OFF button, that Led will go OFF and same function will be performed for second led. There won’t be any connection between the hardware and that web server, the only connection will be the Wifi. The Arduino Shield must have a Wifi connection available and one sitting from across the world can control them. Now let’s discuss these two parts, one by one.

Online Web Server

I have designed the online web server on my own site The Engineering Projects. This is a php page which I have uploaded on my web server. In order to make this page, simply follow the below steps:

  • Create a notepad and rename it to ArduinoWifi.php and save it somewhere, from where you can easily access it.
  • The webserver code is for sale and you can buy it just for $50. We have input a lot of effort to accomplish this project that's why we have placed a very small amount on it. You can easily buy it by clicking the below button.

Buy WebServer Code

  • Save the file again and our web page is now ready to be uploaded. This web page will act as a web server for the Arduino device and will send commands to it.
  • Now we need to upload this web page on some website so that it can start working. In order to do so, you must have some web domain and hosting as I have mine on Godaddy or you can also use some free web hosting service.
  • What this code is doing, its actually using a file system. Whenever any button on this web page is pressed, it simply create a txt file with a letter. In this code, when someone pressed LE 1 ON button, character “1" is saved in the txt file. Similarly character “2" is saved in the txt file when LED 1 OFF is pressed and so on.

Note:

  • When you upload the webpage on the web server, then hit any button and check your web location where this page is uploaded, you must find a data.txt file in the same location.
  • If you can’t find the data.txt then generate it by yourself because in some web servers, generation of such files automatically is not granted.
We are done with the Web Server part, now let’s come to the Arduino Web Client part.  

Arduino Web Client

  • First of all, place the Arduino Wifi Shield over the Arduino UNO shield, as shown in the below figure:

  • Now, you need to place the two leds on two your Arduino UNO. The pin configuration for these LEDs are shown in the below figure:

   
  • Two leds are connected to pin no 3 and 4 of Arduino UNO board and are pulled down.
  • Now connect your Arduino UNO board with the computer and burn the below sketch into it.
 #include <SPI.h>

 #include <WiFi.h>

char ssid[] = “EvoWingle-12F3“; // your network SSID (name)

 char pass[] = “093B3453“; // your network password (use for WPA, or use as key for WEP)

 int keyIndex = 0; // your network key Index number (needed only for WEP)

int status = WL_IDLE_STATUS;

 char server[] = “www.theengineeringprojects.com“; // name address for Google (using DNS)

 String location = “/Examples/data.txt HTTP/1.0“;

 char inString[500]; // string for incoming serial data

 int stringPos = 0; // string index counter

 byte statusLed = 0;

 char c;

 int led1 = 3;

 int led2 = 4;

 WiFiClient client;

unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds

 boolean lastConnected = false; // state of the connection last time through the main loop

 const unsigned long postingInterval = 10*1000; // delay between updates, in milliseconds

void setup() {

 //Initialize serial and wait for port to open:

 Serial.begin(9600);

 pinMode(led1,OUTPUT);

 pinMode(led2,OUTPUT);

digitalWrite(led1, LOW);

 digitalWrite(led2, LOW);

// check for the presence of the shield:

 if (WiFi.status() == WL_NO_SHIELD) {

 Serial.println(“WiFi shield not present”);

 // don’t continue:

 while(true);

 }

// attempt to connect to Wifi network:

 while ( status != WL_CONNECTED) {

 Serial.print(“Attempting to connect to SSID: “);

 Serial.println(ssid);

 // Connect to WPA/WPA2 network. Change this line if using open or WEP network:

 status = WiFi.begin(ssid, pass);

// wait 10 seconds for connection:

 delay(10000);

 }

 Serial.println(“Connected to wifi”);

 printWifiStatus();

Serial.println(“nStarting connection to server…”);

 // if you get a connection, report back via serial:

 if (client.connect(server, 80)) {

 Serial.println(“connected to server”);

 // Make a HTTP request:

 client.print(“GET “);

 client.println(location);

 client.println(“Host: theengineeringprojects.com”);

 // client.println(“Connection: close”);

 client.println();

 //readPage();

 }else{

 Serial.println(“connection failed”);

 }

 }

 void loop(){

while (client.available()) {

 c = client.read();

 Serial.write(c);

 CheckingStatus();

 }

if (!client.connected() && lastConnected) {

 Serial.println();

 Serial.println(“disconnecting.”);

 client.stop();

 }

 if(!client.connected() && (millis() – lastConnectionTime > postingInterval)) {

 PingRequest();

 }

 lastConnected = client.connected();

 }

 void PingRequest(){

 if (client.connect(server, 80)) {

 // Serial.println(“connected to server”);

 // Make a HTTP request:

 client.print(“GET “);

 client.println(location);

 client.println(“Host: theengineeringprojects.com”);

 client.println(“Connection: close”);

 client.println();

 //readPage();

 lastConnectionTime = millis();

 }else{

 //Serial.println(“connection failed”);

 client.stop();

 }

 }

 void CheckingStatus(){

 inString[stringPos] = c;

 if(c == ‘*’)

 {

 statusLed = inString[stringPos - 1];

 stringPos = 0;

 // Serial.write(statusLed);

 delay(500);

 UpdatingStatus();

 // delay(500);

 // client.flush();

 // delay(10000);

 //PingServer();

 }

 stringPos ++;

}

void UpdatingStatus(){

 if(statusLed == ’1')

 {

 digitalWrite(led1, HIGH);

 // Serial.write(‘OK’);

 }

 if(statusLed == ’2')

 {

 digitalWrite(led1, LOW);

 }

 if(statusLed == ’3')

 {

 digitalWrite(led2, HIGH);

 }

 if(statusLed == ’4')

 {

 digitalWrite(led2, LOW);

 }

 }

void printWifiStatus() {

 // print the SSID of the network you’re attached to:

 Serial.print(“SSID: “);

 Serial.println(WiFi.SSID());

// print your WiFi shield’s IP address:

 IPAddress ip = WiFi.localIP();

 Serial.print(“IP Address: “);

 Serial.println(ip);

// print the received signal strength:

 long rssi = WiFi.RSSI();

 Serial.print(“signal strength (RSSI):”);

 Serial.print(rssi);

 Serial.println(” dBm”);

 }
  • Before burning this sketch into your Arduino Shield, you need to change few things which I have written in bold style in the above code, and mentioned below:Now, everything’s done, so power up your Arduino and make sure that it has got connected with the Wifi and then hit the LED 1 ON button on your web page. If everything’s gone fine then the led on your Arduino board will get ON.
    • ssid is the name of your Wifi connection.
    • pass is the password of your wifi connection.
    • server is the server name on which the web page is uploaded, which in my case is my own site.
    • location is the location of the txt file generated by the webpage, the above web page code generated a txt file in the same location and gives it a name data.txt so I simply used that. (This part is bit confusing but read it twice and you will get it.)
  • I have added comments with the Arduino code but if still, you get into some trouble, ask in comments and I will try my best to resolve them.
Note:
  • Before starting anything, first run the demo code which comes with the Arduino Library and make sure that your Arduino Shield get connected with your Wifi connection.
  • Give the link of txt file generated by the web page, not the the web page itself.

That’s all for today, Stay Blessed, take care. :))

Modelling of DVB-T2 system using Consistent Channel Frequency MATLAB

Buy This Project

Hello friends, today I am going to post a complete project designed on MATLAB named as Modelling of DVB-T2 system using Consistent Channel Frequency in MATLAB. This project is designed by our team and it involved a lot of effort to bring it into existence that's why its not free but as usual I have discussed all the details below related to it, which will help you understanding it and if you want to buy it then you can click on the Buy button shown above.

This project aims to implement a DVB-T2 (Digital Video Broadcasting for terrestrial television) system using consistent channel frequency responses. Tthe code is designed to use the same output from a channel model for different transmitter configurations so that consistency of performance results can be obtained. After that the overall project will be modified to repeat an experiment “n” times collecting data so that “x%” confidence intervals can be calculated. Historically, DVB is a project worked by more than 250 companies around Europe at first and now worldwide. DVB-T2 is the world’s most advanced digital terrestrial television (DTT) system, offering more robustness, flexibility and at least 50% more efficiency than any other DTT system. It supports SD, HD, mobile TV, or any combination thereof. The GUI for DVB-T2 parameters selection in MATLAB is shown on the left.

MATLAB Simulations & Results

DVB-T2 is the second generation standard technology used for digital terrestrial TV broadcasting. As it’s a new technology so it has many fields to explore and research, and the best way of researching on any new technology is via simulations. Simulations provide an easy and efficient way to evaluate the performance of any system. For simulation purposes, MATLAB software was chosen in this thesis because of its wide range of tools and ability to show graphical results in a very appropriate form. . Further, this DVB-T2 simulation model could be extended easily to simulate DVB-H, which shares many features with DVB-T2 (only the physical layer that needs modification). The most important feature, I discussed in my simulations are:

  • Comparison of Bit Error Rate (BER) and Signal to noise Ratio (SNR).

DVB-T2 scheme can handle wide range of sub carriers from a range of 1k to 32k; these sub carriers can be fixed or mobile. In this thesis, experiments are performed on mobile transmission of signals to 4000 sub carriers. Below are discussed three different mobile scenarios, for different speeds of mobiles user, which are:

  • Pedestrian moving at the speed of 0.1 km/h.
  • Bus moving at the speed of 5km/h.
  • Car moving at the speed of 10 km/h.

In all the scenarios, the factors mentioned below are kept constant so that a real comparison can be obtained and it could be checked that whether the speed affects the signal or not. These constant factors are:

  • Transmission Mode is SISO.
  • Transmitting Antenna Cross Correlation is 0.5.
  • Receiving Antenna Cross Correlation is 0.5.
  • Environment considered for these simulations is rural.
  • Radio Channel type is Rayleigh with k factor of 1000.
  • Carrier frequency is 91.429MHz.

1.1  Initial MATLAB model

During this thesis, help was taken from a MATLAB model of DVB-T2 transmission system designed by a student at Brunel University. First this initial model was studied and then enhanced it to a higher level. The first model designed by the student at Brunel University, performed the iterations on the DVB-T2 system and gives the results for just one cycle. Explanation of this initial model is discussed in detail below.

1.1.1    Explanation of Initial Model

After the user input all the values in the GUI, this model first calculates the below three values depending on the number of subcarriers attached to the DVB-T2 system.

  • Useful OFDM period.
  • Maximum number of sub carriers.
  • IFFT / FFT length.

After getting this information, the model performs the QAM modulation over the signal so that it could be sent from the transmitter to the receiver. Next, depending on the value of Pilot Pattern given by the user, it calculates the scattered Pilot Amplitudes for the system. After that, it calculates the distortion in transmission depending on area in which the signal is propagating.

In order to calculate the distortion, FFT technique is performed on the signals to get their frequency response. As the signal has already sent from the transmitter after QAM modulation so demodulation on the receiver side is necessary. The model performs the same and demodulates the signal and finally it calculates the value of Signal to noise ratio (SNR) and Bit Error Rate (BER). At the end, it simply plots the graphs of SNR and BER for the visual representation.

1.1.2    Results of Initial Model

Different experiments were performed on the initial model and checked its results. The results are given below for three different experiments, which are:

  • Speed of mobile = 0.1 km/s , Total Iterations = 5000
  • Speed of mobile = 1.0 km/s , Total Iterations = 5000
  • Speed of mobile = 10 km/s , Total Iterations = 5000

Results of these experiments are shown in figure 6.1, 6.2 and 6.3 respectively. Table 6.1, 6.2 and 6.3 gives the values of BER and average BER for all the values of SNR. If these three graphs are closely examined then it can be shown that the band limited impulse response increases as the speed increase and so as the BER and SNR.

The reason for such behavior is that because as the speed of the mobile increase, signal distortion also increases and it becomes difficult for the receiver to catch the signal, that’s the main reason that user travelling in high speed vehicle faces more distortion as compared to a pedestrian.

Results of First Experiment (Speed = 0.1km/s, Iterations = 5000)

 
SNR BER & Average BER
SNR: 0 BER:0.103833
SNR: 0 NoAvrg_BER:0.160358
SNR: 5 BER:0.014366
SNR: 5 NoAvrg_BER:0.033706
SNR: 10 BER:0.000206
SNR: 10 NoAvrg_BER:0.001528
SNR: 15 BER:0.000002
SNR: 15 NoAvrg_BER:0.000107
SNR: 20 BER:0.001543
SNR: 20 NoAvrg_BER:0.002319
SNR: 25 BER:0.000076
SNR: 25 NoAvrg_BER:0.000184
SNR: 30 BER:0.000000
SNR: 30 NoAvrg_BER:0.000164

BER & Average BER Vs. SNR for experiment 1

Results of Second Experiment (Speed = 1km/s, Iterations = 5000)

SNR BER & Average BER
SNR: 0 BER:0.140855
SNR: 0 NoAvrg_BER:0.195596
SNR:5 BER:0.046527
SNR:5 NoAvrg_BER:0.071364
SNR:10 BER:0.011363
SNR:10 NoAvrg_BER:0.019860
SNR:15 BER:0.003815
SNR:15 NoAvrg_BER:0.006448
SNR:20 BER:0.000604
SNR:20 NoAvrg_BER:0.001222
SNR:25 BER:0.000214
SNR:25 NoAvrg_BER:0.000404
SNR:30 BER:0.000233
SNR:30 NoAvrg_BER:0.000503
BER & Average BER vs. SNR for experiment 2

Results of Third Experiment (Speed = 10km/s, Iterations = 5000)

SNR BER & Average BER
SNR: 0 BER:0.128177
SNR: 0 NoAvrg_BER:0.182924
SNR:5 BER:0.056198
SNR:5 NoAvrg_BER:0.084254
SNR:10 BER:0.023229
SNR:10 NoAvrg_BER:0.035131
SNR:15 BER:0.006793
SNR:15 NoAvrg_BER:0.010362
SNR:20 BER:0.001748
SNR:20 NoAvrg_BER:0.002801
SNR:25 BER:0.000425
SNR:25 NoAvrg_BER:0.000691
SNR:30 BER:0.000354
SNR:30 NoAvrg_BER:0.000515

BER & Average BER vs. SNR for experiment 3

Although the results given by these simulations were quite accurate but they were not accurate enough to be trusted, as they were performing the process just for one period and getting the results on the basis of that.

Final MATLAB Model after Modifications

The initial MATLAB model is modified in this thesis, in order to use the same output from the channel model with different transmitter configurations to obtain more consistent results that can be compared with each other. Then theDVB-T2model will be modified so that it can be simulated using Matlab n times collecting data so that an x% confidence interval can be measured.

The results obtained after modifications were very consistent as they were performing the whole scenario for N times (defined by the user), this attribute lacks in the initial model as it was performing the complete task just for one cycle of time and any kind of distortion could fluctuate the results. While in modified model, the same process was performed by N times defined by the user and the results obtained are actually the average of all the cycles and hence providing a very consistent output, which couldn’t be distorted by any external factors.

Moreover, this new model further enhanced the initial model to calculate the Mean BER as it will give the overall performance of BER and average BER. Furthermore, calculates the standard BER on the basis of which global BER is also calculated.

As the simulation of DVB-T2 requires a lot of input parameters from the user, that’s why a GUI is also designed in MATLAB, which makes the working of this project user friendly. User can easily change the parameters of the system using that GUI. On startup, the GUI looks like as shown in figure 4.2:

GUI for DVB-T2 parameters selection

As mentioned above, taking all the other parameters constant, three experiments are performed for the mobile user moving at different speeds with different Iterations and no. of repeats, which are:

  • Pedestrian moving at the speed of 0.1 km/h, with no of iterations = 500 and N=2.
  • Bus moving at the speed of 5km/h, with no of iterations = 200 and N=2.
  • Car moving at the speed of 10 km/h, with no of iterations = 1000 and N=2.

1.2.1    Results of First Experiment of Modified Model:

Results of the first experiment are shown in the figure 6.5, 6.6 and 6.7 respectively. While the theoretical values of BER and average BER for the corresponding SNR are shown in table 6.4 and the Mean BER and std BER are shown in table 6.5.

  • Value of Global BER for the experiment comes out to be -2.4021.

Results for Experiment 1 (Speed=0.1km/s, Iterations=500, N=2)

Results for Experiment 1 (Speed=0.1km/s, Iterations=500, N=2)

Results for Experiment 1 (Speed=0.1km/s, Iterations=500, N=2)

For N=1 For N=2
SNR: 0 BER:0.131272 SNR: 0 BER:0.131542
SNR: 0 NoAvrg_BER:0.185916 SNR: 0 NoAvrg_BER:0.186218
SNR:1 BER:0.107086 SNR:1 BER:0.106672
SNR:1 NoAvrg_BER:0.157698 SNR:1 NoAvrg_BER:0.157319
SNR:2 BER:0.086805 SNR:2 BER:0.086459
SNR:2 NoAvrg_BER:0.129841 SNR:2 NoAvrg_BER:0.129562
SNR:3 BER:0.087178 SNR:3 BER:0.086924
SNR:3 NoAvrg_BER:0.128066 SNR:3 NoAvrg_BER:0.127755
SNR:4 BER:0.081465 SNR:4 BER:0.081709
SNR:4 NoAvrg_BER:0.116619 SNR:4 NoAvrg_BER:0.116581
SNR:5 BER:0.028071 SNR:5 BER:0.028074
SNR:5 NoAvrg_BER:0.051596 SNR:5 NoAvrg_BER:0.051751
SNR:6 BER:0.016450 SNR:6 BER:0.016439
SNR:6 NoAvrg_BER:0.030762 SNR:6 NoAvrg_BER:0.030725
SNR:7 BER:0.012705 SNR:7 BER:0.012607
SNR:7 NoAvrg_BER:0.022399 SNR:7 NoAvrg_BER:0.022108
SNR:8 BER:0.036446 SNR:8 BER:0.036612
SNR:8 NoAvrg_BER:0.052421 SNR:8 NoAvrg_BER:0.052642
SNR:9 BER:0.026200 SNR:9 BER:0.026378
SNR:9 NoAvrg_BER:0.039987 SNR:9 NoAvrg_BER:0.040434
SNR:10 BER:0.014162 SNR:10 BER:0.014155
SNR:10 NoAvrg_BER:0.023779 SNR:10 NoAvrg_BER:0.023805
SNR:11 BER:0.007526 SNR:11 BER:0.007539
SNR:11 NoAvrg_BER:0.013874 SNR:11 NoAvrg_BER:0.013838
SNR:12 BER:0.015524 SNR:12 BER:0.015382
SNR:12 NoAvrg_BER:0.023693 SNR:12 NoAvrg_BER:0.023602
SNR:13 BER:0.005303 SNR:13 BER:0.005448
SNR:13 NoAvrg_BER:0.008758 SNR:13 NoAvrg_BER:0.008764
SNR:14 BER:0.008712 SNR:14 BER:0.008823
SNR:14 NoAvrg_BER:0.014517 SNR:14 NoAvrg_BER:0.014421
SNR:15 BER:0.013224 SNR:15 BER:0.013144
SNR:15 NoAvrg_BER:0.019547 SNR:15 NoAvrg_BER:0.019305
SNR:16 BER:0.001919 SNR:16 BER:0.001890
SNR:16 NoAvrg_BER:0.003767 SNR:16 NoAvrg_BER:0.003703
SNR:17 BER:0.002873 SNR:17 BER:0.002907
SNR:17 NoAvrg_BER:0.004932 SNR:17 NoAvrg_BER:0.005001
SNR:18 BER:0.000610 SNR:18 BER:0.000641
SNR:18 NoAvrg_BER:0.001197 SNR:18 NoAvrg_BER:0.001243
SNR:19 BER:0.006294 SNR:19 BER:0.006231
SNR:19 NoAvrg_BER:0.009262 SNR:19 NoAvrg_BER:0.009209
SNR:20 BER:0.001799 SNR:20 BER:0.001749
SNR:20 NoAvrg_BER:0.003268 SNR:20 NoAvrg_BER:0.003248
SNR:21 BER:0.000966 SNR:21 BER:0.000998
SNR:21 NoAvrg_BER:0.001677 SNR:21 NoAvrg_BER:0.001636
SNR:22 BER:0.001733 SNR:22 BER:0.001778
SNR:22 NoAvrg_BER:0.002772 SNR:22 NoAvrg_BER:0.002883
SNR:23 BER:0.004920 SNR:23 BER:0.004914
SNR:23 NoAvrg_BER:0.007638 SNR:23 NoAvrg_BER:0.007743
SNR:24 BER:0.000089 SNR:24 BER:0.000098
SNR:24 NoAvrg_BER:0.000220 SNR:24 NoAvrg_BER:0.000234
SNR:25 BER:0.000001 SNR:25 BER:0.000001
SNR:25 NoAvrg_BER:0.000052 SNR:25 NoAvrg_BER:0.000052
SNR:26 BER:0.000408 SNR:26 BER:0.000393
SNR:26 NoAvrg_BER:0.000695 SNR:26 NoAvrg_BER:0.000646
SNR:27 BER:0.000583 SNR:27 BER:0.000600
SNR:27 NoAvrg_BER:0.001222 SNR:27 NoAvrg_BER:0.001242
SNR:28 BER:0.000352 SNR:28 BER:0.000381
SNR:28 NoAvrg_BER:0.000609 SNR:28 NoAvrg_BER:0.000625
SNR:29 BER:0.000107 SNR:29 BER:0.000124
SNR:29 NoAvrg_BER:0.000365 SNR:29 NoAvrg_BER:0.000384
SNR:30 BER:0.000367 SNR:30 BER:0.000351
SNR:30 NoAvrg_BER:0.000720 SNR:30 NoAvrg_BER:0.000695

SNR Vs. BER values for Experiment 1

Mean BER std BER
-0.8814 0.0006
-0.9711 0.0012
-1.0623 0.0012
-1.0602 0.0009
-1.0884 0.0009
-1.5517 0.0000
-1.7840 0.0002
-1.8977 0.0024
-1.4374 0.0014
-1.5802 0.0021
-1.8490 0.0001
-2.1231 0.0005
-1.8110 0.0028
-2.2696 0.0083
-2.0571 0.0039
-1.8799 0.0019
-2.7203 0.0046
-2.5391 0.0035
-3.2039 0.0151
-2.2033 0.0031
-2.7511 0.0086
-3.0078 0.0099
-2.7556 0.0079
-2.3083 0.0004
-4.0308 0.0285
-6.1938 0
-3.3978 0.0118
-3.2281 0.0086
-3.4365 0.0247
-3.9387 0.0460
-3.4455 0.0137

Mean BER & std BER values for Experiment 1

1.2.2    Results of Second Experiment of Modified Model:

Figure 6.8, 6.9 and 6.10 gives us the results for the experiment 2, when user is travelling at the speed of 1km/s and the no of iterations taken here are 500 with repeat cycle i.e. N=2. Table 6.6 and 6.7 gives us the values of SNR vs. BER and the Mean BER and standard BER respectively.
  • Global BER comes out for experiment 2 was –inf.

Results for Experiment 2 (Speed=1km/s, Iterations=500, N=2)

Results for Experiment 2 (Speed=1km/s, Iterations=500, N=2)

Results for Experiment 2 (Speed=1km/s, Iterations=500, N=2)

For N = 1 For N = 2
SNR: 0 BER:0.144963 SNR: 0 BER:0.144537
SNR: 0 NoAvrg_BER:0.200382 SNR: 0 NoAvrg_BER:0.200617
SNR:1 BER:0.103536 SNR:1 BER:0.103496
SNR:1 NoAvrg_BER:0.153318 SNR:1 NoAvrg_BER:0.153312
SNR:2 BER:0.081079 SNR:2 BER:0.081874
SNR:2 NoAvrg_BER:0.123080 SNR:2 NoAvrg_BER:0.123966
SNR:3 BER:0.056279 SNR:3 BER:0.056618
SNR:3 NoAvrg_BER:0.096223 SNR:3 NoAvrg_BER:0.096636
SNR:4 BER:0.070647 SNR:4 BER:0.070241
SNR:4 NoAvrg_BER:0.103436 SNR:4 NoAvrg_BER:0.103023
SNR:5 BER:0.063094 SNR:5 BER:0.063427
SNR:5 NoAvrg_BER:0.089725 SNR:5 NoAvrg_BER:0.090577
SNR:6 BER:0.020785 SNR:6 BER:0.021318
SNR:6 NoAvrg_BER:0.039970 SNR:6 NoAvrg_BER:0.040469
SNR:7 BER:0.024660 SNR:7 BER:0.024455
SNR:7 NoAvrg_BER:0.040979 SNR:7 NoAvrg_BER:0.041170
SNR:8 BER:0.032986 SNR:8 BER:0.032662
SNR:8 NoAvrg_BER:0.052140 SNR:8 NoAvrg_BER:0.052100
SNR:9 BER:0.023306 SNR:9 BER:0.022988
SNR:9 NoAvrg_BER:0.037168 SNR:9 NoAvrg_BER:0.037283
SNR:10 BER:0.009120 SNR:10 BER:0.008878
SNR:10 NoAvrg_BER:0.017749 SNR:10 NoAvrg_BER:0.017499
SNR:11 BER:0.023258 SNR:11 BER:0.023224
SNR:11 NoAvrg_BER:0.034964 SNR:11 NoAvrg_BER:0.034473
SNR:12 BER:0.023534 SNR:12 BER:0.023745
SNR:12 NoAvrg_BER:0.034579 SNR:12 NoAvrg_BER:0.034325
SNR:13 BER:0.000103 SNR:13 BER:0.000101
SNR:13 NoAvrg_BER:0.000588 SNR:13 NoAvrg_BER:0.000648
SNR:14 BER:0.000016 SNR:14 BER:0.000010
SNR:14 NoAvrg_BER:0.000196 SNR:14 NoAvrg_BER:0.000231
SNR:15 BER:0.000009 SNR:15 BER:0.000014
SNR:15 NoAvrg_BER:0.000209 SNR:15 NoAvrg_BER:0.000240
SNR:16 BER:0.001996 SNR:16 BER:0.002008
SNR:16 NoAvrg_BER:0.003367 SNR:16 NoAvrg_BER:0.003535
SNR:17 BER:0.002367 SNR:17 BER:0.002430
SNR:17 NoAvrg_BER:0.003467 SNR:17 NoAvrg_BER:0.003535
SNR:18 BER:0.000002 SNR:18 BER:0.000004
SNR:18 NoAvrg_BER:0.000010 SNR:18 NoAvrg_BER:0.000018
SNR:19 BER:0.001298 SNR:19 BER:0.001367
SNR:19 NoAvrg_BER:0.002071 SNR:19 NoAvrg_BER:0.002116
SNR:20 BER:0.009918 SNR:20 BER:0.009850
SNR:20 NoAvrg_BER:0.014701 SNR:20 NoAvrg_BER:0.014585
SNR:21 BER:0.000472 SNR:21 BER:0.000521
SNR:21 NoAvrg_BER:0.000769 SNR:21 NoAvrg_BER:0.000854
SNR:22 BER:0.001085 SNR:22 BER:0.001169
SNR:22 NoAvrg_BER:0.001855 SNR:22 NoAvrg_BER:0.001917
SNR:23 BER:0.001360 SNR:23 BER:0.001495
SNR:23 NoAvrg_BER:0.002240 SNR:23 NoAvrg_BER:0.002427
SNR:24 BER:0.000595 SNR:24 BER:0.000621
SNR:24 NoAvrg_BER:0.001258 SNR:24 NoAvrg_BER:0.001321
SNR:25 BER:0.000873 SNR:25 BER:0.000820
SNR:25 NoAvrg_BER:0.001457 SNR:25 NoAvrg_BER:0.001422
SNR:26 BER:0.000003 SNR:26 BER:0.000003
SNR:26 NoAvrg_BER:0.000199 SNR:26 NoAvrg_BER:0.000201
SNR:27 BER:0.000326 SNR:27 BER:0.000342
SNR:27 NoAvrg_BER:0.000637 SNR:27 NoAvrg_BER:0.000651
SNR:28 BER:0.000198 SNR:28 BER:0.000216
SNR:28 NoAvrg_BER:0.000270 SNR:28 NoAvrg_BER:0.000262
SNR:29 BER:0.000000 SNR:29 BER:0.000000
SNR:29 NoAvrg_BER:0.000000 SNR:29 NoAvrg_BER:0.000000
SNR:30 BER:0.000000 SNR:30 BER:0.000000
SNR:30 NoAvrg_BER:0.000071 SNR:30 NoAvrg_BER:0.000078

SNR Vs. BER values for Experiment 2

Mean BER Std BER
0.8394 0.0009
0.9850 0.0001
1.0890 0.0030
1.2483 0.0018
1.1522 0.0018
1.1989 0.0016
1.6767 0.0078
1.6098 0.0026
1.4838 0.0030
1.6355 0.0042
2.0458 0.0083
1.6337 0.0005
1.6264 0.0027
3.9915 0.0072
4.8895 0.1323
4.9486 0.1512
2.6985 0.0018
2.6201 0.0081
5.5089 0.1569
2.8755 0.0159
2.0051 0.0021
3.3048 0.0302
2.9484 0.0231
2.8460 0.0291
3.2160 0.0133
3.0727 0.0192
5.4949 0
3.4765 0.0154
3.6850 0.0273
Inf NaN
Inf NaN

Mean BER and std BER values for Experiment 2

Remarks

This thesis presents the design and Implementation of DVB-T2 system in MATLAB software. The basic purpose of this thesis is to check the bit error ratio (BER) and signal to noise ratio (SNR) for DVB-T2 system so that the system could be improved to a better quality. DVB-T2 system is evaluated for mobile users moving at different speeds. It is clearly shown that the mobility has an impact on the received signal, where the SNR goes to zero in some points. This behavior will generate high BER. If the figures for impulse responses are checked for all the three experiments then it is depicted that the Impulse is high for the third experiment where the mobility speed is higher than the first two experiments. The packet data loss is almost zero for the first experiment while it’s increasing in the second and is higher in the third. The number of packet lost confirms this behavior that high losses occurred in the case of high mobility.

Introduction to MPLAB Compiler

Hello friends, I hope you all are doing great. In today's tutorial, I am going to give you a detailed Introduction to MPLAB Compiler. MPLAB is used for PIC programming both in assembly and C languages. In my previous posts, I have completely explain how to install MPLAB software and also the C compiler for MPLAB.Today I am going to explain getting started with MPLAB. This chapter doesn't belong to programming but the initials required for programming. Setting a project in MPLAB is not much difficult but obviously beginners don't know much about it and they think that its a crap and very difficult. Although its not and i think its the best programming compiler for PIC Microcontroller. Easy and fully controllable. In the coming tutorial we are gonna design a small project in which we will do LED Blinking using PIC Microcontroller. So let's start it.

Steps To Follow

I believe that you have installed the MPLAB Software which I have emailed to all the subscribed users on our site. If anyone didn't receive it yet then get subscribed on our site and I will email it to you. You should also have a look at these Top 3 PIC C Compilers. Now follow these steps carefully and if you feel any problem let me know in comments.

Step 1
  • Open the software by clicking on the icon placed on your desktop or in the start menu. It will open as shown in the figure below:
Step 2
  • Now first we need to make a new project to start our programming so click on Project and then New.
Step 3
  • By clicking on New, it will open a new dialog box, where you need to put the Project name and the destination of your project and click OK.
  • I recommend to choose a separate folder for each of your project so that the files never mixed up.
Step 4
  • After clicking OK you will see that nothing changed and you are unable to see your newly created project.
  • So to view your project click on the View and then Project as shown in image below:
  • Now after clicking on project a small window on the right side will open.
  • Its called Tree in programming language and it shows all the files you are using in your project but right now its empty because you didn't add any file in your project, you have just created it.
Step 5
  • Lets add files in your project. So for this click on the File and then New and you will see a file will open with the name Untitled. this is the file in which we will add our programming code.
  • But first we need to add it in our project otherwise it will remain just a notepad file.
  • Sorry, I don't have image for this step actually it got lost, i think its not much difficult :))
Step 6
  • So now to add you file in your project, click on the File and the Save as.
  • A new dialog box will open, now enter name of your project and add it in the same location where you created your project.(it's not necessary but files of project should remain in the same location) and then click Save.
  • Here comes the important part must add .c extension after the name of your file. This .c extension will tell the compiler that its our C programming file.
 
Step 7
  • Now we have created our c file but we didn't add it in our project. ( Saving in same location doesn't mean that you have added it your project)
  • So to add the file in your project, right click on the Source File in the left side panel and then click on Add Files as shown in the image below.
  • It will open a dialog box now select your recently created file with the extension .c and click save and you will see that it will appear under the Source File folder.
Step 8
  • Now we need to add the header, library and linker files in our project.
  • So repeat the same process and right click on the Header Files and then Add Files.
  • Now the question is where to find the header file.Move to the location where you have installed your C compiler, the default location is C drive and the name is MCC18.
  • Open MCC18 Folder and there you will see many folders.
  • To add the header file click on the folder with the name "h" (h for header).
  • In this folder you will see a lot of files, which file to select depends on the PIC you are using.
  • As I am using PIC18F452 so I wrote p18F452 in the File name box and in the suggestions i got my file with the name p18f452.h and i selected it and click save as shown in the image below.
Step 9
  • Repeat the same process for linker and library files.
  • For linker file open the folder with the name "lkr" in the MCC18 folder and for library file open the folder "lib" and select the file with name of your Microcontroller.
  • I have added all my files as shown in the image below and now my project is complete.
  • That's all our project structure has completed, now if you want to do coding just add it in your newly created .c file and if you want to save the project then click on File and then Save Workspace and it will save your project.
  • In our next class we will add the code in the .c file and execute it on our pic.
I hope you have enjoyed this detailed Introduction to MPLAB Compiler for PIC Microcontroller. Till next tutorial ALLAH HAFIZ ...... stay blessed ..... and keep remembering me in your prayers .... :))

Installation of MPLAB C Compiler

Hello friends, hope you all are fine and enjoying good health. In today's tutorial we are gonna have a look at Installation of MPLAB C Compiler in Windows. In the previous part of this chapter, I have explained How to install the MPLAB software in Windows, that part was not much tricky and we did very easily and our software was then ready to use, but as we didn't install the C compiler so we can't do C programming for PIC Microcontroller on MPLAB. We can only do assembly programming on it. Now in this post I will teach you how to install MPLAB C18 compiler so that we can do programming of PIC in C. There are many different compilers available in the market, one of them is MikroC and another famous one is CCS but they are paid compilers means you have to buy them, in order to work on them. You should also have a look at Introduction to MPLAB Compiler.

Although they provide some demo version as well which has some limit of hex size. Why MPLAB is better than MikroC or any other compiler is because it is very flexible. You can change any bit of your Microcontroller in MPLAB but this thing isn't possible in other compilers. But on the other side it also more difficult than other compilers. MikroC has builtin libraries using which you can save quite a lot of time. Suppose you wanna run LCD, then in MikroC you just need to write 2 lines but in MPLAB there will be quite a lot code lines need to be written. Here's a comparison of Top 3 PIC C Compilers. So, anyways its just a little comparison, now lets come back to our tutorial and start with Installation of MPLAB C Compiler.

Installation of MPLAB C Compiler

  • The software has already been emailed to all the subscribed members. If you are not subscribed yet then get subscribed and it will be emailed to you as well.
  • Open the rar file and you will see there are two folders in it, this time open the second folder named MPLAB C18 F and run the exe file in it.
  • The next screen appears will be like the below image. On this step click Next.
  • Now the below image will appear, click on I Accept and then click Next.
  • Browse for the location where you want to install the compiler but i will recommend to install it in the C so don't change the location.
  • Now don't change any option and just click Next again as shown in below image:
  • Now here comes the real part, check all the boxes as shown in below image, they make the work easier and while making a project you don't need to add them manually.
  • Again you will come with four option and do the same thing check all the boxes as shown in the image below.
  • Now simply click on Next.
  • And finally your software will begin to install.
  • When the installation process is completed , uncheck all the options and just click on the finish button and your C compiler is now ready for use.

Advice

  • Always install the MPLAB software first and then the C compiler. Actually C compiler links itself with the MPLAB software so it will become very handy for you.
  • It seems like a lengthy proces but in actual its not, just a few clicks and you are done.
I hope you have enjoyed today's tutorial and now can easily install MPLAB C Compiler for PIC Microcontroller. Will meet you guys in next tutorial. Till then take care & have fun !!! :)

How to Install MPLAB Software in Windows

No. MPLAB Tutorials
Give Your Suggestions !!!
1. Getting Started With Microcontrollers
2. Getting Started with PIC Microcontrollers
3. Functions Available in PIC18F452
4. How to Install the MPLAB Software
5. How to Install the MPLAB C18 Compiler
6. Getting started With MPLAB
7. LED Blinking Project on PIC Microcontroller

Hello friends, hope you all are fine and enjoying good health. Previously, we have seen Functions available in PIC18F452. In today's tutorial we are gonna have a look at How to install MPLAB software. Until now, we have seen only what is PIC Microcontroller and what is it capable of? Now we are gonna move a little further and will see how we can burn program into it and get it our slave. So in order to make the PIC our slave, we have to burn some coding into it and even before that we need some platform where we can actually write this coding and this platform is provided by Microchip itself and is called MPLAB.

MPLAB is a software in which we write a programming code for PIC Microcontroller. It is basically a compiler which compiles the code and then create its hex file, which we later uploads in our microcontroller. I have explained this thing before in Getting Started with PIC Microcontroller. Now before going any further, we will first have a look on how to install MPLAB software in Windows. So in this tutorial, I will explain the step by step the whole process of installing MPLAB. MPLAB supports assembly language, which we are not gonna learn in this class so, after installing the MPLAB software we also have to install the MPLAB C compiler, which we will install in the coming tutorial, so first install this MPLAB software and then move to the next tutorial to install C compiler.

Steps to Install MPLAB

  • You can download MPLAB software quite easily from official site of MPLAB as its free of cost.
  • Open the rar file and you will see there are two folders in it, open the folder named MPLAB_IDE_v8_56 and run the file setup.exe
  • The next screen appears will be like that :
  • Click on Modify and then on Next and the next screen will be like below image :
  • Don't do any changing and again click on Next.
  • On the next window,click the NEXT button again.
  • The software will now begin to install and after complete installation the final window will popup simply click on FINISH.
  • That's all your software has been installed.
  • Now simple open the software and start programming but you can only do programming in assembly language.

The first part of this tutorial has been completed. In the next part, I will explain how to install the MPLAB C compiler so that you can also do programming in C language in MPLAB.

Till then take care ...... ALLAH HAFIZ :))

Functions Available in PIC18F452 Microcontroller

In the previous tutorial, I explained Getting Started with PIC microcontrollers and the software etc. Today, I am going to explain the hardware of PIC18F452 i.e. the functions available in PIC18F452. In other words, working of pins. We have a total of 40 pins in 18F452 microcontroller. Different PIC microcontrollers have different pins and different functions. Some of the PIC Microcontrollers lack the below functions and some of them have much more functions than these. So, here I am just discussing the PIC Microcontroller 18F452 because it is a moderate one and is mostly used in engineering projects. It's an 8-bit microcontroller. So now we are gonna have a look at the functions available in the PIC18F452 microcontroller. In the next tutorial, I have discussed How to install MPLAB software in Windows and have also discussed How to Install MPLAB C18 Compiler.

Ports

There are a total of five ports in PIC18F452. Each port is 1 byte (8 bits) and so each port has 8 pins of microcontroller except the portE which has 3 pins. These ports are named as:

  • PORTA ( Pin # 2 to Pin # 10 )
  • PORTB ( Pin # 33 to Pin # 40 )
  • PORTC ( Pin # 15 to Pin # 18 & Pin # 23 to Pin # 26 )
  • PORTD ( Pin # 19 to Pin # 22 & Pin # 27 to Pin # 30 )
  • PORTE ( Pin # 8 to Pin # 10 )

You can access any pin of any port. Ports' pins are assigned as 0,1,2,3,4,5,6,7 and 7 being the most significant bit and 0 the least so suppose I want to use PIN 3 of port B then I will write RB2. We will see it in more detail in the coding section and as it's just the hardware section I am not going into detail about this.

Timers in PIC18F452

We have a total of four built-in timers in the PIC18F452. These timers are also used as counters. We can set them to count anything or to set delays etc. For example, we want to make a digital watch on LCD using PIC, in that case, we will use timers to count. Four timers used in PIC18F452 are:

  • Timer0
  • Timer1
  • Timer2
  • Timer3

Serial Port Interfacing

PIC18F452 also supports serial interfacing using TX & RX pins. Suppose we are using any sensor and want to make a graph of its output on the PC, then we will attach the sensor to any of the input pins and then send its data to the computer using TX and RX pins. In PIC18F452:

  • TX pin is pin # 25
  • RX pin is pin # 26

We use the TX pin of the PIC when we want to transmit data from the PIC to the computer and RX when we want to receive data into the PIC.

Some Other Functions

These are some advanced-level functions that I will explain in the advanced section but interested readers can ask in comments or can contact me. However, sooner or later, I will post about all of them in detail.

  • Interrupts in PIC18F452
  • A/D converter
  • EEPROM storage
  • CCP and ECCP Programming
  • SPI Protocol
  • I2C Protocol

Getting Started with PIC Microcontrollers

In the last tutorial, we discussed Getting Started with Microcontrollers and how they work and now we are gonna have a look at Getting Started with PIC Microcontrollers. PIC microcontrollers, as I mentioned before, are manufactured by Microchip. There are many types of microcontrollers but here I am concerned with PIC18F452.So let's have a small review of PIC18F452 PIC microcontrollers.

PIC18F452 is a 40-pin microcontroller each pin has its functionality, which we will see in our next classes one by one. suppose I want to create a project on LED blinking, a simple project on PIC so what do I have to do? First of all, I need the following things so that I may use them to work with PIC. I have discussed the Functions available in the PIC18F452 Microcontroller in the next post.

Important Points

  • MPLAB ---> MPLAB is a software which you can download easily from the official website of Microsoft as it's an open source software. In MPLAB you will do programming in Assembly & C Language. We will learn Assembly & C Language in our next classes.

NOTE: We will learn the Assembly & C language in our next classes. This software has already been sent to all the registered users. If you need it, then Subscribe to our Email Notification and this will be forwarded to you. Thanks.

  • PIC Programmer ----> There are many PIC Programmers available in the market. You have to attach this Programmer to the PC through a serial port (Parallel Port & USB Port PIC Programmer are also available). Now Put your PIC in the 40-pin socket of the Programmer.
  • PICpgm Software / PICKit software ----> This software is used to burn the program in the PIC. It's just the same as burning a movie on DVD. Now open this software and browse to your program which you have made in MPLAB and then click on program PIC and your Program will be burnt on your PIC.
  • PIC Basic Circuit ---->PIC alone never works, we have to add a simple circuitry to make it work Below figure shows the simple PIC circuit. It is not very difficult and you can make it on a simple vero board with soldering. I have given its circuit below :

Now remove your PIC microcontrollers from the Programmer and add them to the hardware circuit and you will check that your PIC will give you the same results as you have programmed in it. In this tutorial, we have just taken an overview of PIC Microcontrollers. Next, we will check its Ports and the purpose of these ports. Till then take care ALLAH HAFIZ .... :))

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir