Microcontroller › 8051 › project on microcontroller based power factor improvent by static vars compensation
- This topic has 6 replies, 2 voices, and was last updated 13 years, 7 months ago by amjadhussain.
-
AuthorPosts
-
May 19, 2011 at 8:41 am #946amjadhussainParticipant
dear fellows,
i am making project on microcontroller based power factor improvent by static vars compensation as my final year project in b.sc electrical engineering
please help me in this regard
from
amjad hussain
May 20, 2011 at 5:06 am #6284dagakshayParticipantnice project,
what you required from our side…
here i am pasting a link related to you project.. see if it help full for you
May 20, 2011 at 12:32 pm #6285amjadhussainParticipanthi dear fellows,,
i found a code of interfacing of ADC0808 with 89c51 here,this is the code
// Program to test ADC 0808. The output pins are connected to LED's. external clock is used for driving the ADC 0808.
#include<reg51.h>
sbit ale=P1^0; //address latch enable
sbit oe=P1^3; //output enable
sbit sc=P1^1; //start conversion
sbit eoc=P1^2; //end of conversion
sbit ADD_A=P1^4; // Address pins for selecting input channels.
sbit ADD_B=P1^5;
sbit ADD_C=P1^6;
sfr input_port=0x80;
sfr output_port=0xA0;
void delay(unsigned int count) // Function to provide time delay in msec.
{
int i,j;
for(i=0;i<count;i++)
for(j=0;j<1275;j++);
}
void main()
{
eoc=1;
input_port=0xFF;
ale=0;
oe=0;
sc=0;
while(1)
{
ADD_C=0; // Selecting input channel 2 using address lines
ADD_B=0;
ADD_A=1;
delay(2);
ale=1;
delay(2);
sc=1;
delay(1);
ale=0;
delay(1);
sc=0;
while(eoc==1);
while(eoc==0);
oe=1;
output_port=input_port;
delay(2);
oe=0;
}
but it working when i put it into the keil ,it gives synatax error in its last 4 to five lines ,i am very worried about my project because time is very short so please help me and check this code ,and tell me why it is not working and send me its corrected form at
best regards
May 20, 2011 at 12:44 pm #6286amjadhussainParticipanthere is program of lcd interfacing with 89c51,,,,,,
//Program to test LCD. Display single character "A"
#include<reg51.h>
#define cmdport P3
#define dataport P2
#define q 100
sbit rs = cmdport^0; //register select pin
sbit rw = cmdport^1; // read write pin
sbit e = cmdport^6; //enable pin
void delay(unsigned int msec) // Function to provide time delay in msec.
{
int i,j ;
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}
void lcdcmd(unsigned char item) //Function to send command to LCD
{
dataport = item;
rs= 0;
rw=0;
e=1;
delay(1);
e=0;
}
void lcddata(unsigned char item) //Function to send data to LCD
{
dataport = item;
rs= 1;
rw=0;
e=1;
delay(1);
e=0;
}
void main()
{
lcdcmd(0x38); // for using 8-bit 2 row mode of LCD
delay(100);
lcdcmd(0x0E); // turn display ON for cursor blinking
delay(100);
lcdcmd(0x01); //clear screen
delay(100);
lcdcmd(0x06); //display ON
delay(100);
lcdcmd(0x86); // bring cursor to position 6 of line 1
delay(100);
lcddata('A');
}
i picked the programme from here it is also not working and showing syntax error in last 4 to five lines,,,
what is problem with it please check it and send me the corrected programme at
best regards
May 20, 2011 at 1:06 pm #6287amjadhussainParticipantfollowing arethe error messages when i run the file of ADC0808 interfacing with 89c51(code given above)
wali.asm(43): error A9: SYNTAX ERROR
wali.asm(44): error A9: SYNTAX ERROR
wali.asm(45): error A9: SYNTAX ERROR
wali.asm(46): error A9: SYNTAX ERROR
wali.asm(47): warning A41: MISSING ‘END’ STATEMENT
Target not createdplease check it why it is giving this problem
this is not only in this case but also in case of code of lcd interfacing with 89c51 i.e same kind of error messages (giving syntax errors in last 4 to five lines)
regards
May 21, 2011 at 4:47 am #6288dagakshayParticipanthello amjadhussain,
you have saved your file in .asm extension which is used to write assembly code.. but the code you have pased is written in C language so you getting error there…
see this link it migh be help full for you…
http://www.engineersgarage.com/forums/8051/how-create-new-project-keil
May 23, 2011 at 5:59 pm #6293amjadhussainParticipanthello
i have made circuit of interfacing of ADC0808 with 89c51given on
it is giving showing all leds off(i.e all ports connected to these leds are red) except which is connected at pin 28(it is showing blue ) of mc,so according to given pattern all leds are off except cpnnected at 28 pin of mc this pattern is not effected by varying the resistance (sensor) connected at pin 27 of ADC0808,i could not understand the problem,
please help me in this regard,guid me about the circuit i.e which kind of output it gives and how it is effected by change in resitance connected at pin 27 of ADC
please help me by providing the guidance,
i am expecting usual kind response from u
regards
mjd hussain
-
AuthorPosts
- You must be logged in to reply to this topic.