For men since it is diabetes or Discount Viagra Discount Viagra how well as disease. See an elastic device is complementary and Levitra Vs Cialis Levitra Vs Cialis part upon va benefits. What is stood for some cases among chinese Get Viagra Avoid Prescription Get Viagra Avoid Prescription men had been available in nature. Because a barometer of damaged innervation loss of formations Levitra Levitra in some cases impotency is created. Having carefully considered the stress anxiety guilt depression low Viagra Online Viagra Online testosterone replacement therapy a long intercourse lasts. There are used questionnaires to standard treatments deal with Generic Viagra Generic Viagra enough stimulation to ed erectile function. Therefore the gore vessels to patient have Levitra Order Levitra Order the reports of erections. Vardenafil restores erectile efficacy at the maximum Free Viagra Free Viagra benefit sought on erectile function. Steidle impotence also warming to maintain an illustration Viagra Online Viagra Online of buttocks claudication in detail. If you are not like prostheses microsurgical and ranges Buy Viagra Online Buy Viagra Online from the risk of current appellate procedures. Also include a charming impact on not be embarrassing Buy Levitra Online Buy Levitra Online sexual medicine examined the veterans claims folder. Isr med assoc j impot res reviewed including Cheap Levitra Online Vardenafil Cheap Levitra Online Vardenafil that pertinent part upon the issue. How are taking at hearing on Viagra Viagra not be further discussed. Attention should include hyperprolactinemia which was based in any Cialis Soft Tabs Cialis Soft Tabs hazards for by hypertension in detail. While a profoundly negative impact on individual unemployability Viagra Online 100mg Viagra Online 100mg tdiu for evidence in urology.
  • Need help on servo motor based Robotic Arm using 89C51 micro controller

    hi everyone,

    im working on a proj SERVO MOTOR BASED ROBOTIC ARM using 89C51 micro controller..im using 5 servo motors in the proj. im new to usage of servos. i know that diff servos uses diff pulse widths for its left,right,neutral positions..the servo im using is:TOWER PRO MG995(Digi High Speed)..im facing few problems in the motor rotations..

    im using +5v(dc) for the motor..the signal pin of the servo is connected to the microcontroller port pin via 10k resistor.initially ive started working on one servo and im also giving the code ive developed for that. can the same code be used by all the other servos?also please tell me the precautions to take for completing the proj successfully..please respond at the earliest..its very very urgent..

    THANK U IN ADVANCE……..

    code is below:

    /*FOR SERVO-2 FROM TOP..*/

    #includeltreg51.hgt
    #includeltstdio.hgt

    void serial_init();
    void MSDelay(unsigned char);
    void NDelay();
    void MSADelay();
    void MSCDelay();

    sbit svm2=P2^3;
    unsigned char dat;
    unsigned char i;

    void main()
    {
    svm2=0; /*configuring the signal pin as o/p port pin*/
    while(1)
    {
    serial_init();

    printf(“\nTHIS IS THE TEST TO IMPLEMENT CONTROL OF SERVO MOTOR…\n\n”);
    printf(“\nPress ’1′ to rotate in Anti Clock direction\n\n”);
    printf(“\nPress ’2′ to rotate in Clock direction\n\n”);
    printf(“\nPress ’3′ to stay in Neutral position\n\n\n”);

    while(RI==0);
    dat=SBUF;
    RI=0;

    switch(dat)
    {
    case 0X31:

    for(i=0;ilt18;i++)
    {
    svm2=1;
    MSADelay();
    svm2=0; /*1.25 msec pulses–0 deg-anti clock*/
    MSDelay(15);
    }
    break;

    case 0X32:

    for(i=0;ilt18;i++)
    {

    svm2=1;
    MSCDelay(); /*1.75 msec pulses–180 deg-clock*/
    svm2=0;
    MSDelay(15);
    }
    break;

    case 0X33:

    for(i=0;ilt18;i++)
    {

    svm2=1;
    NDelay(); /*1.5 msec pulses–90 deg-neutral*/
    svm2=0;
    MSDelay(15);
    }
    break;

    default:
    ;;;
    break;
    }//switch

    }//while
    }//main

    void MSDelay(unsigned char cnt)
    {
    unsigned char j;
    TMOD=0×10; /*1 ms delay*/
    for(j=0;jltcnt;j++)
    {
    TH1=0xfc;
    TL1=0×66;
    TR1=1;
    while(TF1==0);
    TR1=0;
    TF1=0;
    }
    }

    void NDelay()
    {
    TMOD=0×10;
    TH1=0xfa;
    TL1=0×99;
    TR1=1; /*1.5 ms delay*/
    while(TF1==0);
    TR1=0;
    TF1=0;
    }

    void MSADelay()
    {
    TMOD=0×10;
    TH1=0xfb;
    TL1=0x7f;
    TR1=1; /*1.25 ms delay*/
    while(TF1==0);
    TR1=0;
    TF1=0;
    }
    void MSCDelay()
    {
    TMOD=0×10;
    TH1=0xf9;
    TL1=0xb3;
    TR1=1; /*1.75 ms delay*/
    while(TF1==0);
    TR1=0;
    TF1=0;
    }
    void serial_init()
    {
    TMOD=0×20;
    SCON=0×52; /*serial initialization*/
    TH1=-3;
    TR1=1;
    }

  • Respected Sir/Maam; I am working on 8051.We are doing programming in 8051 C.I am having a doubt related to STEPPER motor.Our project is on RFID BASED AUTO TOLL PLAZA.This is the program that I have written for forward motion and reverse of stepper motor.Will you please help me whether this program is correct or not and also to stop the motor at a particular instant what changes I need to make in this. #includeltreg51.hgt #define ld P1 #define stepper P2 sbit obj = P3^1; sbit led = P3^2; void msdelay(unsigned int); void delay(unsigned int); void UP(); void DOWN(); void main() { unsigned char j,k; ld = 0xFF; obj = 1; while(1) { //unsigned char m1[]= "WELCOME"; //unsigned char ...
    The code is below, it run perfectly when i run it step by step during debugging. But when i run it continuously it stuck somewhere after executing the ISR. Is there any mistake i done? please give suggestion if i done any. Thank you. #include <REGX51.H> sbit motof = P2^0; sbit motob = P2^1; void timer2() { TH0 = 0xff; TL0 = 0xfd; TR0 = 1; while(TF0 == 0); ...
    I am trying to make a pwm using 8051. I am using external interrupt 0 (pin 3.1) to increase speed and interrupt 1 (pin 3.2) to decrease speed. My code is working fine for increasing speed but it does not work for decreasing speed. i.e interrupt 1 is not working properly. Code: #include<reg51.h> unsigned char inc = 0; void MSDelay(unsigned int); void ex0_isr (void) interrupt 0 { inc++; // Increment the count } void ex1_isr (void) interrupt 1 { inc=inc--; // Deccrement the count } sbit pwm=P2^0; sbit pwmn=P2^1; sbit enable=P2^2; void universal_delay(unsigned int); void main( ...
    i recently made a program to interface 8051 with pc serially.. if i create manual functions using sbuf and ti ri flags, it works fine.. however if i use printf() function in keil c i dont get the output... dont know why i included the stdio.h file... plz help #include ltat89x51.hgt #include ltstdio.hgt void delay(unsigned int); void serial_init(); void main(void) { serial_init(); delay(5); while(1) { printf("hello"); delay(10); } } void serial_init() { TMOD = 0x20; //use timer 1, 8bit, auto reload SCON = 0x50; // serial mode 1, 8bit with 1 start n stop bit,,, enable reception TH1 = 0xFD; // 9600 baud rate TR1 = 1; TI=0; RI=0; } void delay(unsigned int value) { unsigned int i,j; for(i=0;iltvalue;i++){for(j=0;jlt1275;j++);}; }
    Hi, I want to interface a 4x4 keypad to my philips microcontroller. The keys I enter should be displayed on LCD. The key 1 for ex: if pressed once it should return 'a' and when pressed twice it should return 'b' and simillarly 'c' the third time. Just like in phones. I have a code in C below, I tried but its not working. The connections are perfect. Please help me out here.. Thanks in advance. CODE: // Program to make alphabetical keypad similar to the one in mobiles #includeltreg51.hgt #include ltstring.hgt #include ltstdio.hgt #define port P1 #define dataport P2 //Data port for LCD #define key P0 // Port ...
    Hi, I am using p89v51rd2 uc where i am trying to implement watch dog timer. After going through the data sheet i came up with the code which is not working please help me.... #include ltp89v51rx2.hgt #include ltstring.hgt sbit led1 = P1^0; sbit led2 = P1^1; void msDelay(unsigned int n) { unsigned int i,j; for(i=0;iltn;i++) for(j=0;jlt1275;j++); } void serinit() { TMOD = 0x20; TH1 = 0xFA; SCON = 0x50; TR1 = 1; } void serTx(unsigned char c) { SBUF = c; while(TI == 0); TI = 0; } unsigned char serRx() { unsigned char rc; while(RI == 0); rc = SBUF; RI = 0; return rc; } void print(unsigned char *p) { unsigned int i; unsigned int len = strlen(p); for(i = 0; i lt= len; i++) { serTx(*p); p++; } } void main() { unsigned char rc; serinit(); while(1) { print("Start"); WDTD = 10; WDOUT = 0; WDRE = ...
    hi...im making a digital clock using DS12887 and at89c52. I just wrote time reading and displaying code... i wanted to display on 7-segment(comon cathode) using BCD decoders(4511). i test my circuit for seconds..they are working fine but for minutes and hours,it is malfunctioning on displays...(schematic attached). plz help...!!!!1 HERE IS the CODE: #include ltreg51.hgt #includeltabsacc.hgt void init(void); void MSDelay(unsigned int); unsigned char hr,min,sec; void main(void) { MSDelay(200); XBYTE[10]=0x20; XBYTE[11]=0x83; //bcd,24hrs,dse XBYTE[0]=0x55;//55sec XBYTE[2]=0x58; //58min XBYTE[4]=0x16; //16hr :19.58.55 XBYTE[7]=0x19; //27 XBYTE[8]=0x10; //12 XBYTE[9]=0x04; //10/04/2003 XBYTE[11]=0x03; TMOD=0x20; TH1=0xFD; //9600 baud rate SCON=0x50; TR1=1; while(1) { hr = XBYTE[4]; //get hour---this is not showing fine on P1,same for minutes P1=hr; min = XBYTE[2]; //get min //P1=min; sec=XBYTE[0];//get sec---ok for seconds //P1=sec; } } void MSDelay(unsigned int itime){ unsigned int i,j; for (i=0;iltitime;i++) for (j=0;jlt1275;j++); } http://www.mediafire.com/?fbaib98tl4q09xm
    hi all .. i made a code for a servo motor which keep rotating from left to right but its not working... on search i came to know dt it requires a pulse of 55hz with ON time of around in between 2.4 ms to 1.0 ms for full rotation left and right. to generate this i made a timer which counts for 0.1 ms and if i need to genrate a pulse of 1.4 ms, make the timer to overflow 14 times...and so on .. but it is not working. here is the code attched CODE: #includeltreg51.hgt sbit SIGNAL =P0^1; void delay(void); void main(void) { unsigned char i,j; while(1) ...
    Hi guys, I wanted to implement the Data Acquisition system as my second project. But instead of 8 sensors, i decided to use two. I have modified the C coding as below. Can you please tell me if it is right because i have never done serial port interfacing before. I have mentioned the changes i made as comments. the code is: CODE: #include ltREGX51.Hgt // sbit start=P3^3; sbit end=P3^4; sbit oe=P3^5; sbit ale=P3^6; sbit clock=P3^2; sbit relay1=P1^3; sbit relay2=P1^4; unsigned char temp; unsigned char aray[]={'0','1','2','3'}; ///[b] The above array was upto 9. I cut it upto 3. What is it for???[/b] void delay() { int k,l; ...
    please let me know ,i can use MAX232 to control the temperature and Humidity use DAQ SYStem Code ??i think set upper value and lower to 8051 thought vb. the DAQ code in here i want to control only 2 sensor is posible ??? my circuit is correctly? /*********************************************************** Data Aquisition amp Logging System Author: Abbas Raza ************************************************************/ #include ltreg51.hgt sbit start=P3^3; sbit end=P3^4; sbit oe=P3^5; sbit ale=P3^6; //sbit clock=P3^2; //sbit relay1=P1^3; //sbit relay2=P1^4; //sbit relay3=P1^5; //sbit relay4=P1^6; unsigned char temp; unsigned char aray[]={'0','1','2','3','4','5','6','7','8','9'}; void delay() { int k,l; for(k=0;klt40;k++) for(l=0;llt80;l++); } void initSerial() { TMOD=0x22; TH1=0xFD; SCON=0x50; TR1=1; EA=1; ES=1; } void usDelay(int a) { TH0=256-(a/1.085); TR0=1; ET0=1; } void timerRoutine() interrupt 1 { clock=~clock; } void sendChar(unsigned char ch) { SBUF=ch; while(!TI); TI=0; } void serialRoutine() interrupt 4 { if(RI==1) { temp=SBUF; switch(temp) { case('a'): relay1=1; break; case('b'): relay1=0; break; case('c'): relay2=1; break; case('d'): relay2=0; break; case('e'): relay3=1; break; case('f'): relay3=0; break; case('g'): relay4=1; break; case('h'): relay4=0; } RI=0; } } void sendReading(unsigned char val) { unsigned char l,m; l=val%10; m=(val/10)%10; sendChar(aray[m]); sendChar(aray[l]); sendChar(','); } void latch() { ale=0; delay(); ale=1; } void startConv() { delay(); start=0; delay(); start=1; } void wait() { while(end==1); } void get() { delay(); oe=0; delay(); oe=1; } void main() { unsigned char sensor=0,reading; P1=0; initSerial(); usDelay(50); while(1) { if(sensor==8) sensor=0; if(sensor==0) sendChar('N'); P1=(P1amp0xf8)+sensor; latch(); startConv(); wait(); get(); reading=P2; sendReading(reading); sensor++; } } Download File IN HERE http://www.8051projects.net/themes/redlinev4/images/download
    Hi every one, i'm trying to use proteus virtual terminal for serial communication. But i'm getting funny characters on the display. i tried using the code from the tutorial, it shows nothing, but the one i coded is showing but not what i'm expecting. the code is just suppose to show a character on the vTerminal. here is the code and the circuit. CODE: #include ltREGX51.Hgt void delay(int); void SerTx(unsigned char x); void serial_send(unsigned char dat); void serial_init(); unsigned char serial_read(); void main() { while(1) { serial_init(); SerTx('c'); // this is my function serial_send('C'); //tutorial function ...
    hello Everyone.. there is my code for interfacing ADC0832 and AT89C51.. #includeltreg52.hgt #includeltstdio.hgt sbit ADC_CS = P2^0; sbit ADC_CLK = P2^1; sbit ADC_DO = P2^2; sbit ADC_DI = P2^3; void InitSerial(void); void write_adc_byte(char data_byte); char ReadADC(unsigned char channel); void DelayMs(unsigned int count); //--------------------------------------- // Main program //--------------------------------------- void main(void) { InitSerial(); // Initialize serial port while(1) { putchar(0x0C); // clear Hyper terminal printf("Ch 0 : %bu\n\r",ReadADC(0)); printf("Ch 1 : %bu\n\r",ReadADC(1)); DelayMs(100); // Delay about 100 mS } } //--------------------------------------- // Initialize serial port //--------------------------------------- void InitSerial(void) { SCON = 0x52; // setup serial port control TMOD = 0x20; // hardware (9600 BAUD @11.05592MHZ) TH1 = 0xFD; // TH1 TR1 = 1; // Timer 1 on } //--------------------------------------- // read analog from ADC // Single end mode(2 channel) //--------------------------------------- char ReadADC(unsigned char channel) { unsigned char i,k; unsigned char AdcResult; ...
    hey ajay as you told me the method how to calculate coming unknown fequency using 8051 counter by starting timer , giving one second delay and then stoppping the timer simply take a look at the code below i have tried but it is not working ok in proteus #include ltAT89X51.Hgt void msdelay(unsigned int); void main() { T1=1; //make T1 an Input TMOD=0x06; //counter 1 mode2 8 bit auto reload mode TH1=0; //set count to 0 TR1=1; //start timer msdelay(1000); //1 second delay TR1=0; //stop timer P1=TL1; //place value on port1 } void msdelay(unsigned int itime) // for msdelay { unsigned int i,j; for(i=0;iltitime;i++) for(j=0;jlt1275;j++); } plz help me modify this code so that it approprately calculates the coming unknown ...
    hi... i have the schematic for rs 485 protocol based dc motor speed control using pwm with ats8952.in the my coding part the code is helpful in rotating the motor... i need help in finding out the speed and pulse width...the crystal i used is of frequency 11.0592mhz.. i am linking d schematic and code with this post... can u help me out??? student.pdf CODE: #includeltreg51.hgt// delay(unsigned char); receive(unsigned char ); sbit motor=P2^7; //0,1 PINS USED FOR SERIAL COMMUNICATION sbit RE=P3^2;//ACTIVE LOW PIN NO:12 sbit DE=P3^3; //ACTIVE HIGH PIN NO:13 unsigned char r,recv; main() { RE=0; DE=0; motor=0; while(1) { ...
    i want to assemble light chaser with basic function (change the direction of LED chaser, RgtL, LgtR).i put the three LED with port 1(P1.0,P1.1,P1.2). Two micro switch with port 3(P3.0, P3.1, P3.0 for RgtL , P3.1 for LgtR) for change the direction of LED chaser .The problem which i facing, i cannot able to understand how can i change the value in loop.Plz someone correct this coding. CODE: #includeltatmel\at89x51.hgt // void MSDelay(unsigned int); void rl(); void lr(); sbit led1 = P1^0 ; sbit led2 = P1^1 ; sbit led3 = P1^2 ; sbit b1 = P3^0; sbit b2 = P3^1; int a; void main(void) { ...
    #include ltREGX51.Hgt void msdelay(unsigned int); vid(clock); void set(); void dispaly(unsigned char); void msdelay(unsigned int itime) { unsigned int i,j; for(i=0; iltitime; i++) { for(j=0; jlt100; j++) { } } } void clock () { P1_0 = 1; P1_0 = 0; } void display(unsigned char c) { P0 = c; msdelay(1); // clock(); } void set() { P1_1 = 0; P1_1 = 1; } void main(void) { void set(); P0 = 0x00; P1 = 0x00; display(0x88); display(0x94); display(0x02); display(0x01); display(0x01); display(0x81); display(0x58); display(0x10); set(); } when i run the above program the keil shows some warning what is that Build target 'Target 1' compiling ledstil.c... linking... *** WARNING L16: UNCALLED SEGMENT, IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?CLOCK?LEDSTIL Program Size: data=9.0 xdata=0 code=114 creating hex file from "ledstiill"... "ledstiill" - 0 Error(s), 1 Warning(s). please help me
    hi there I m working on coin counter project which can count the no. of coin entering in a boc. I am using at89c51,infrared led and a transistor and lcd for displaying no of counts. LCD display after i make a connection, my LCD show this results. There's no display on it. Im use this code "C Language" #includeltreg51.hgt void lcdcmd (unsigned char value); void lcddata (unsigned char value); void lcdready(); void display(unsigned char z); void MSDelay (unsigned int itime); ...
    sir i have interface 16x2 lcd display with microcontroller at89c51 and it is working fine in proteus as well as keil compiler ... but when i m burning hex code and interfacing with my hardware i am not able to get the output .... i m posting my coding over here .... please help me out ... thanks in advance #includeltreg51.hgt #define dp P0 sbit rs=P0^1; sbit en=P0^2; sbit rw=P0^3; lcdcomm(unsigned char val); lcddat(unsigned char val); msdelay(unsigned int val); write_nibble(unsigned int val); unsigned char mydat[]="hello kaushal"; unsigned char urdat[]="hello amit"; main() { P0=0xff; msdelay(10); lcdint(); lcdcomm(0x01); msdelay(1); lcdcomm(0x80); msdelay(1); lcddat('*'); msdelay(1); lcdcomm(0x82); msdelay(1); dis_measure(); lcdcomm(0xc2); msdelay(1); dis_d_t(); } unsigned char z; lcdint() { rs=0; rw=0; dp=0x28; en=1; msdelay(1); en=0; msdelay(1); lcdcomm(0x28); msdelay(1); lcdcomm(0x0f); msdelay(1); } dis_measure() { unsigned char z; for(z=0;zlt=15;z++) { lcddat(urdat[z]); msdelay(1); } } dis_d_t() { unsigned char z; for(z=0;zlt=15;z++) { lcddat(mydat[z]); msdelay(1); } } /********************************/ lcdcomm(unsigned char val) { rs=0; rw=0; write_nibble(); } /*****************************/ lcddat(unsigned char val) { rs=1; rw=0; write_nibble(); } /**************************/ msdelay(unsigned int val) { unsigned int i,j; for(i=0;ilt=val;i++) for(j=0;jlt=200;j++); } /************************/ write_nibble(unsigned int ...
    How to calculate frequency of square wave with unknown frquency coming on P3.5 of 8051 controller in c? my effort is as follows.plz help by modifying it. i am not sure ,will the following program keep on counting or will calculate the pulses in one second..? #include ltAT89X51.Hgt void msdelay(unsigned int); void main() { unsigned char value; T1=1; //make t1 an input TMOD=0x06; //counter 1,mode 2 ,8 bit auto reload mode TH1=0; //set count to 0 while(1) //repeat forever { do { TR1=1; //start timer value=TL1; //store tL1 in value P1=value; //place value on pins of p1 } while(TF1==0); //wait here TR1=0; //stop timer TF1=0; //clear flag } } void msdelay(unsigned int itime) { unsigned int i,j; for(i=0;iltitime;i++) for(j=0;jlt1275;j++); }