Ex: No: Date:: To Write A Program To Initialize The Port in GENERIC Microcontroller

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

Ex: No:

PORT INITIALIZATION IN GENERIC MICROCONTROLLER


DATE:

AIM:

To write a program to initialize the port in GENERIC Microcontroller.

APPARATUS REQUIRED:

SNO NAME OF THE APPARUTUS QUANTITY


1. Personal computer with RAM sped of 2.5GHz 1

2. Keil vision4 1

ALGORITHM:

STEP 1: Open Keil Vision-3 Software.


STEP 2 : Go to File Menu select New and open a New text window, which is used to edit
the program.
STEP 3: Select the View menu and go to project window .In project window right click
on “source group1 “folder and select add files to group “source group1” then
add the .c file.
STEP 4: Double click the file name.asm, translate current file in the project.
STEP 5: Go to Project and select build target. Then start the Debug session.
STEP 6: In project window the status of the register will be displayed, run the program
then view the result in the I/O port.
STEP 7: Go to View Menu and select Logic Analyzer Window the Output is viewed in
it.
STEP 8: Stop the Debugging.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAME:

/* this is always done outside any function*/


#include<reg51.h>
sbit p10=0x90;
/* the function may be within to use this location*/
void main(void)
{
/*while loop, toggling pin 0 of port1*/
while(1==1)
{
p10=!p10;
delay:(500);/*wait 500 microsec*/
}
}

RESULT AND OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT:

Thus the port was initialized and the corresponding output was analyzed
using Keil software.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex: No:
GENERATE THE SQUARE WAVE IN GENERIC
DATE: MICROCONTROLLER

AIM:

To generate the Square wave pulse in GENERIC Microcontroller.

APPARATUS REQUIRED:

S.NO NAME OF THE APPARUTUS QUANTITY


1. Personal computer with RAM sped of 2.5GHz 1

2. Keil vision4 1

ALGORITHM:

STEP 1: Open Keil Vision-3 Software.


STEP 2: Go to File select New and open new text window, which is used to edit the
program.
STEP 3: View project window .In project window right click on “source group1 “folder
and select add files to group “source group1” then add the .c file.
STEP 4: Double click the file name.asm, translate current file in the project.
STEP 5: Go to Project and select build target. Then start the Debug session.
STEP 6: In project window the status of the register will be displayed, run the program
then view the result in the I/O port.
STEP 7: Go to View Menu and select Logic Analyzer Window the Output is viewed in
it.
STEP 8: Stop the Debugging.

10EE7P2- EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAME:

#include<reg51.h> //include 8051 register file


sbit pin=P1^0; //declare a variable type sbit for P1.0
main ()
{
P1=0x00; //clear port
TMOD=0x09; //initialize timer0 as 16 bit timer
loop:TL0=0xAF; //loop value 15535=3cAFh so after
TH0=0x3c; //5000 counts timer0 will be overflow
pin=1; //send high logic to p1.0
TR0=1; //statE timer
While (TF0==0){} //wait for first over flow for 50ms
TL0=0xAF; //again reload count
TH0=0x3C;
pin=0; //now sent 0 to p1.0
while (TF0==0){} //wait for 50ms again
goto loop; //continue with the loop
}

RESULT AND OBSERVATION:

10EE7P2- EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT:

Thus the Square wave pulse was generated and corresponding waveform
was obtained using Keil software.

10EE7P2- EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex.No:
GENERATE THE PWM PULSE TO AC MOTOR DRIVE
DATE: USING ATMEL MICROCONTROLLER

AIM:
To generate the gate pulse to AC motor drive using ATMEL microcontroller.

APPARATUS REQUIRED:

SNO NAME OF THE APPARUTUS QUANTITY


1. Personal computer with RAM sped of 2.5GHz 1

2. Keil vision4 1

ALGORITHM:

STEP 1: open keil vision4 software.


STEP 2 : File_new open new text window, which is used to edit the program.
STEP 3: View _project window .In project window right click on “source group1 “folder then
click on add files to group “source group1” then add the program.
STEP 4: Double click the file name.asm, translate current file in the project.
STEP 5: Project_build target.Then start the Debug session.
STEP 6: In project window the status of the register will be displayed, run the program then
view the result in the analyser window.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAMME:

#include<reg51.h> MTR=1;
sbit sw_1=P2^7; for(x=0;x<300;x++);
sbit sw_2=P2^6; MTR=0;
sbit sw_3=P2^5; for(x=0;x<600;x++);
sbit MTR=P1^0; }
void main() if(sw_1==1&sw_2==1&sw_3==1)
{ {
int x; MTR=1;
while(1) for(x=0;x<300;x++);
{ MTR=0;
if(sw_1==0&sw_2==0&sw_3==0) for(x=0;x<300;x++);
{ }
MTR=1; if(sw_1==1&sw_2==0&sw_3==0)
for(x=0;x<5;x++); {
MTR=0; MTR=1;
for(x=0;x<600;x++); for(x=0;x<600;x++);
} MTR=0;
if(sw_1==0&sw_2==0&sw_3==1) for(x=0;x<200;x++);
{ }
MTR=1; if(sw_1==1&sw_2==0&sw_3==1)
for(x=0;x<200;x++); {
MTR=0; MTR=1;
for(x=0;x<600;x++); }
} }
if(sw_1==0&sw_2==1&sw_3==0) }
{

RESULT OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


HEX FILE:
:030000000209747E :1008C000BE02F8BF58F530A6047D0180027D0030DD
:0C097400787FE4F6D8FD758107020800CA :1008D000A7047C0180027C00EC5DFD30A5047C0156
:1008000020A6047D0180027D0020A7047C018002D7 :1008E00080027C00EC5D6020D290E4FEFF0FBF0030
:100810007C00EC5DFD20A5047C0180027C00EC5D89 :1008F000010EBE01F8BF2CF5C290E4FEFF0FBF0051
:100820006020D290E4FEFF0FBF00010EEF64054E82 :10090000010EBE01F8BF2CF520A6047D0180027DFA
:1008300070F5C290E4FEFF0FBF00010EBE02F8BFCC :100910000030A7047C0180027C00EC5DFD20A50472
:1008400058F520A6047D0180027D0020A7047C01CC :100920007C0180027C00EC5D6020D290E4FEFF0F31
:1008500080027C00EC5DFD30A5047C0180027C0000 :10093000BF00010EBE02F8BF58F5C290E4FEFF0FE3
:10086000EC5D6020D290E4FEFF0FBF00010EEF644C :10094000BF00010EEF64C84E70F520A6047D018043
:10087000C84E70F5C290E4FEFF0FBF00010EBE022D :10095000027D0030A7047C0180027C00EC5DFD304C
:10088000F8BF58F530A6047D0180027D0020A70442 :10096000A5047C0180027C00EC5D7003020800D2CB
:100890007C0180027C00EC5DFD20A5047C018002CF :0409700090020800E9
:1008A0007C00EC5D6020D290E4FEFF0FBF00010EE3 :00000001FF
:1008B000BE01F8BF2CF5C290E4FEFF0FBF00010E91

RESULT:

Thus the PWM pulse was generated & corresponding generated pulse was analysed
using keil software.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex: No:
LCD INTERFACING USING EMBEDDED
DATE: MICROCONTROLLER

AIM:

To Interface LCD using the Embedded Microcontroller.

APPARATUS REQUIRED:

S.NO NAME OF THE APPARUTUS QUANTITY


1. Personal computer with RAM sped of 2.5GHz 1

2. Embedded training Kit (PIC 16F877) 1

ALGORITHM:

STEP 1: Open Mikro C Pro for PIC v.6.0.0.


STEP 2: Goto File select New -> New Project (Enter the project name) -> click OK and
Select the device name -> Next.
STEP 3: Write the coding for Interfacing the LCD to the Microcontroller.
STEP 4: Goto Build and build the program.
STEP 5: Open My Computer ->E Drive ->Program -> Micro Electronic Mikro C pro for
PIC. Open with Notepad (HEX file was created).
STEP 6: Goto Tools -> Mikro boot loader -> Connect, the kit will be connected to the
system.
STEP 7: Choose the HEX file and load the program.
STEP 8: Verify the Output.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAME:

sbit LCD_RS at RB0_bit; {


sbit LCD_EN at RB2_bit; TRISB.F3=0;
sbit LCD_D4 at RB4_bit; PORTB.F3=1;
sbit LCD_D5 at RB5_bit; Lcd_Init( );
sbit LCD_D6 at RB6_bit; Lcd_Cmd(_LCD_CURSOR_OFF);
sbit LCD_D7 at RB7_bit; Lcd_Cmd(_LCD_CLEAR);
sbit LCD_RS_Direction at TRISB0_bit; text=”Interfacing LCD”;
sbit LCD_EN_Direction at TRISB2_bit; Lcd_Out(1,1,text);
sbit LCD_D4_Direction at TRISB4_bit; Lcd_chr(2,3,92);
sbit LCD_D5_Direction at TRISB5_bit; text=”Executed”;
sbit LCD_D6_Direction at TRISB6_bit; Lcd_Out(2,5,text);
sbit LCD_D7_Direction at TRISB7_bit; Lcd_chr(2,14,92);
char *text; }
void main( )

RESULT AND OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT:
Thus the program for Interfacing of LCD using Embedded Microcontroller
was written and corresponding Output was obtained.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex: No:
LCD INTERFACING USING RELAY AND BUZZER
DATE:

AIM:

To Interface LCD Relay buzzer using the Embedded Microcontroller.

APPARATUS REQUIRED:

S.NO NAME OF THE APPARUTUS QUANTITY


1. Personal computer with RAM sped of 2.5GHz 1

2. Embedded training Kit (PIC 16F877) 1

ALGORITHM:

STEP 1: Open Mikro C Pro for PIC v.6.0.0.


STEP 2: Goto File, select New -> New Project (Enter the project name) -> click OK and
Select the device name -> Next.
STEP 3: Write the coding for Interfacing the LCD Relay Buzzer to the Microcontroller.
STEP 4: Goto Build and build the program.
STEP 5: Open My Computer ->E Drive ->Program -> Micro Electronic Mikro C pro for
PIC. Open with Notepad (HEX file was created).
STEP 6: Goto Tools -> Mikro boot loader -> Connect, the kit will be connected to the
system.
STEP 7: Choose the HEX file and load the program.
STEP 8: Verify the Output.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAME:

sbit LCD_RS at RB0_bit; {


sbit LCD_EN at RB2_bit; PORTC.F0=1;
sbit LCD_D4 at RB4_bit; text="Relay Function";
sbit LCD_D5 at RB5_bit; LCD_OUT(1,1,text);
sbit LCD_D6 at RB6_bit; text="Executed";
sbit LCD_D7 at RB7_bit; LCD_OUT(2,1,text);
sbit LCD_RS_direction at TRISB0_bit; }
sbit LCD_EN_direction at TRISB2_bit; else
sbit LCD_D4_direction at TRISB4_bit; {
sbit LCD_D5_direction at TRISB5_bit; PORTC.F0=0;
sbit LCD_D6_direction at TRISB6_bit; }
sbit LCD_D7_direction at TRISB7_bit; if(PORTD.F1==0)
char *text; {
void main() PORTC.F1=1;
{ text="Buzzer";
TRISD=0XFF; LCD_OUT(1,1,text);
TRISC=0X00; text="Alarm Indication";
TRISB.F3=0; LCD_OUT(2,1,text);
PORTB.F3=1; }
LCD_init(); else
LCD_cmd(_LCD_CURSOR_OFF); {
LCD_cmd(_LCD_CLEAR); PORTC.F1=0;
for(;;) }
{ }
if(PORTD.F0==0) }

RESULT AND OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT:
Thus the program for Interfacing of LCD Relay Buzzer using Embedded
Microcontroller was written and corresponding Output was obtained.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex.No: DC MOTOR DIRECTION CONTROL
USING PIC18F4550
DATE:

AIM:
To control the direction of the dc motor using PIC18F4550 both in clockwise&
anticlockwise direction.

APPARATUS REQUIRED:

SNO NAME OF THE APPARUTUS QUANTITY

1. Personal computer with RAM speed of 2.5GHz 1

2. Embedded training kit (PIC18F4550) 1

ALGORITHM:
STEP 1: open micro C pro PIC v.6.0.0.
STEP 2: File->new->new project->enter the project name, select devices name->next.
STEP 3: Write the coding of the corresponding program needed to be executed .
STEP 4: Go to build->build the program.
STEP 5: Open My Computer->E drive->program->Mikro electronic Mikro PRO for PIC.open
with notepad(HEX file was created).
STEP 6: Go to tools->mikro boot loader->connect->choose HEX file->connect the kit.
STEP 7: Verify the output.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAMME:
sbit LCD_RS at RB0_bit; {
sbit LCD_EN at RB2_bit; PORTE.F0=1;
sbit LCD_D4 at RB4_bit; text = "clockwise";
sbit LCD_D5 at RB5_bit; Lcd_Out(1,1,text);
sbit LCD_D6 at RB6_bit; Delay_ms(5000);
sbit LCD_D7 at RB7_bit; Lcd_Cmd(_LCD_CLEAR);
sbit LCD_RS_Direction at TRISB0_bit; PORTE=0;
sbit LCD_EN_Direction at TRISB2_bit; text = "IDLE";
sbit LCD_D4_Direction at TRISB4_bit; Lcd_Out(1,1,text);
sbit LCD_D5_Direction at TRISB5_bit; Delay_ms(5000);
sbit LCD_D6_Direction at TRISB6_bit; Lcd_Cmd(_LCD_CLEAR);
sbit LCD_D7_Direction at TRISB7_bit; PORTE.F1=1;
char *text; text = "Anticlockwise";
void main() Lcd_Out(1,1,text);
{ Delay_ms(5000);
TRISE=0; Lcd_Cmd(_LCD_CLEAR);
PORTE=1; PORTE=0;
TRISB.F3=0; text = "IDLE";
PORTB.F3=1; Lcd_Out(1,1,text);
Lcd_Init(); Delay_ms(5000);
Lcd_Cmd(_LCD_CURSOR_OFF); Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CLEAR); }while(1);
do }
}
RESULT OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT:
Thus the direction control of dc motor both in clockwise &anticlockwise direction
using PIC18F4550 was executed &controlled ,the corresponding output was analysed.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex.No:
GENERATION OF PWM SIGNALS USING P18F4550
DATE:

AIM:
To generate &control the PWM signals using P1854550.
APPARATUS REQUIRED:

SNO NAME OF THE APPARUTUS QUANTITY

1. Personal computer with RAM speed of 2.5GHz 1

2. Embedded training kit (PIC 16F877) 1

3. Digital oscilloscope(50MHz,1GSa/S)Storage 1

ALGORITHM:
STEP 1: open micro C pro PIC v.6.0.0.
STEP 2: File-> new->new project->Enter project name,select device name->next.
STEP 3: Write the program.
STEP 4: Go to build-> build the program.
STEP 5: Open My Computer->E drive->program->Mikro electronic Mikro PRO for PIC.Open
with notepad (HEX file was created).
STEP 6:.Go to tools->mikro boot loader->connect->choose HEX file->connect the kit.
STEP 7: Verify the output.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAMME:
void InitMain() while (1)
{ {
ADCON0=0X00; if (PORTE.F0==0)
ADCON1=0X0F; {
TRISE = 0XFF; Delay_ms(40);
TRISC = 0; current_duty=current_duty++;
PORTC = 0; PWM1_Set_Duty(current_duty);
PWM1_Init(500000); }
} if (PORTE.F1==0) {
void main() Delay_ms(40);
{ current_duty=current_duty--;
InitMain(); PWM1_Set_Duty(current_duty);
current_duty = 16; }
PWM1_Start(); Delay_ms(3);
PWM1_Set_Duty(current_duty); }

RESULTS OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT :
Thus the generation &controlling of PWM signals using P1854550 ,the program was
analysed using MIKRO_PRO software and output was obtained successfully.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex.No:
STEPPER MOTOR CONTROL USING PIC18F4550
DATE:

AIM:
To control the stepper motor using PIC18F4550 embedded microcontroller .

APPARATUS REQUIRED:

SNO NAME OF THE APPARUTUS QUANTITY

1. Personal computer with RAM speed of 2.5GHz 1

2. Embedded training kit (PIC18F4550) 1

ALGORITHM:
STEP 1: open micro C pro PIC v.6.0.0.
STEP 2: File->new->new project->enter the project name, select devices name->next.
STEP 3: Write the coding of the corresponding program needed to be executed .
STEP 4: Go to build->build the program.
STEP 5: Open My Computer->E drive->program->Mikro electronic Mikro PRO for
PIC. Open with notepad(HEX file was created).
STEP 6: Go to tools-> mikro boot loader->connect->choose HEX file->connect the kit.
STEP 7: Verify the output.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAMME:
sbit LCD_RS at RB0_bit; TRISD=0X00;
sbit LCD_EN at RB2_bit; Lcd_Init();
sbit LCD_D4 at RB4_bit; Lcd_Cmd(_LCD_CURSOR_OFF);
sbit LCD_D5 at RB5_bit; Lcd_Cmd(_LCD_CLEAR);
sbit LCD_D6 at RB6_bit; text="stepper motor";
sbit LCD_D7 at RB7_bit; Lcd_out(1,1,text);
sbit LCD_RS_Direction at TRISB0_bit; text="Running";
sbit LCD_EN_Direction at TRISB2_bit; Lcd_out(2,1,text);
sbit LCD_D4_Direction at TRISB4_bit; while(1)
sbit LCD_D5_Direction at TRISB5_bit; {
sbit LCD_D6_Direction at TRISB6_bit; PORTD=0X03;
sbit LCD_D7_Direction at TRISB7_bit; delay_ms(500);
int i=0; PORTD=0X06;
void main() delay_ms(500);
{ PORTD=0X09;
char*text; delay_ms(500);
TRISB.F3=0; }
PORTB.F3=1;
}
RESULTS OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT :
Thus the controlling of stepper motor using PIC18F4550 was executed &controlled ,the
corresponding output was analyzed.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex: No:
INTERFACING DAC WITH PIC MICRO CONTROLLER
DATE:

AIM:

To interface DAC with pic microcontroller and to obtain the output through led

APPARATUS REQUIRED:

S.NO NAME OF THE APPARUTUS QUANTITY


1. Personal computer with RAM sped of 2.5GHz 1

2. Embedded training Kit (PIC 16F877) 1

ALGORITHM:

STEP 1: Open Mikro C Pro for PIC v.6.0.0.


STEP 2: Goto File select New -> New Project (Enter the project name) -> click OK
and Select the device name -> Next.
STEP 3: Write the coding for Interfacing the LCD Relay Buzzer to the
Microcontroller.
STEP 4: Goto Build and build the program.
STEP 5: Open My Computer ->E Drive ->Program -> Micro Electronic Mikro C pro
for PIC. Open with Notepad (HEX file was created).
STEP 6: Goto Tools -> Mikro boot loader -> Connect, the kit will be connected to the
system.
STEP 7: Choose the HEX file and load the program.
STEP 8: Verify the Output.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAME:
unsigned char WAVEVALUE[28] =
{128,148,168,188,208,228,208,188,168,148,128,108,88,68,48,28,8,0,8,28,48,68,88,108};
//Lookup Table for Sine Wave
void main()
{
unsigned char x;
TRISD=0; // Port D as Output
while(1) // Infinite Loop
{
for(x=0;x<28;x++)
{
PORTD=WAVEVALUE[X];
delay_ms(3);
}
}
}

RESULT AND OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT:

Thus the DAC was interface with the pic microcontroller and the output was obtain through
the led by the constant wavevalues.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


Ex:No:
INTERFACING ADC WITH PIC MICROCONTROLLER
DATE:

AIM:

To interface ADC with pic microcontroller and to obtain the digital output

APPARATUS REQUIRED:

S.NO NAME OF THE APPARUTUS QUANTITY


1. Personal computer with RAM sped of 2.5GHz 1

2. Embedded training Kit (PIC 16F877) 1

ALGORITHM:

STEP 1: Open Mikro C Pro for PIC v.6.0.0.


STEP 2: Goto File select New -> New Project (Enter the project name) -> click OK
and Select the device name -> Next.
STEP 3: Write the coding for Interfacing the LCD Relay Buzzer to the
Microcontroller.
STEP 4: Goto Build and build the program.
STEP 5: Open My Computer ->E Drive ->Program -> Micro Electronic Mikro C pro
For PIC. Open with Notepad (HEX file was created).
STEP 6: Goto Tools -> Mikro boot loader -> Connect, the kit will be connected to the
system.
STEP 7: Choose the HEX file and load the program.
STEP 8: Verify the Output.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


PROGRAME:
sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB2_bit;
sbit LCD_D4 at RB4_bit;
sbit LCD_D5 at RB5_bit;
sbit LCD_D6 at RB6_bit;
sbit LCD_D7 at RB7_bit;
sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB2_bit;
sbit LCD_D4_Direction at TRISB4_bit;
sbit LCD_D5_Direction at TRISB5_bit;
sbit LCD_D6_Direction at TRISB6_bit;
sbit LCD_D7_Direction at TRISB7_bit;

char *text;
int t;
char temp;
char lcd[] = "000";

void main()
{
ADCON0=0x0F; //Turn off A/D convertor at A0
ADCON1=0x0B; //Configure all inputs as digital I/O except A0
ADCON2=0b10001010;
TRISD=0x00; // Configure PortD as output port
PORTD.F4=1; // LCD Backlight On
Lcd_Init();
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_Cmd(_LCD_CLEAR);
Lcd_out(1,1, "Temperature:");
Lcd_out(2,4, "C");
do
{

t = ADC_Read(3);

t = t * 0.4887;
temp = t%10;
lcd[2] = temp + '0';

t = t/10;
temp = t%10;
lcd[1] = temp + '0';

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


t = t/10;
temp = t%10;
lcd[0] = temp + '0';

Lcd_out(2,1,lcd);
Delay_ms(200);
}while(1);
}

RESULT AND OBSERVATION:

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY


RESULT:
Thus the adc was interface with pic microcontroller and the temperature is measured in
form of digital by varying the potentiometer.

10EE7P2-EMBEDDED CONTROL OF ELECTRICAL DRIVES LABORATORY

You might also like