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.
  • Frequency counting

    plz help me modify this code so that it may calculate the frequency of signal for me…

    CODE:
    #include ltAT89X51.Hgt //
    void stepper(unsigned char);//stepper motor
    void msdelay(unsigned int);
    void main()
    {
    unsigned char value;
    T1=1; //make t1 an input
    msdelay(1000); // to count no of pulses in 1 sec
    TMOD=0×06; //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
    stepper(value);
    }

    while(TF1==0); //wait here
    TR1=0; //stop timer
    TF1=0; //clear flag
    }
    }
    void stepper(unsigned char value)
    {
    if(value==00000010) //compare it with 2Hz frequency
    P1=0×66;
    msdelay(200);
    P1=0xCC;
    msdelay(200);
    P1=0×99;
    msdelay(200);
    P1=0×33;
    msdelay(200);
    }
    void msdelay(unsigned int itime)
    {
    unsigned int i,j;
    for(i=0;iltitime;i++)
    for(j=0;jlt1275;j++);
    }

    Related Forum Messages

    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++); }
  • 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 ...
    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( ...
    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 ...
    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 ...
    Hi, i have written a small program wherein i change the value on Pot and see the value on the LCD. but m not able to see anything. Please help. the program is as follows. #include ltreg51.hgt sbit rd = P2^5; // for ADC sbit wr = P2^6; // for ADC sbit INTR = P2^7; // for ADC sbit rs = P2^0; // for LCD initilisation sbit rw = P2^1; // for LCD initilisation sbit en = P2^1; // for LCD initilisation sfr ldata = 0x90; //select port 1 for LCD input sfr MYDATA = 0x0B0; //select port 3 for input from ADC void MSDelay(unsigned int itime) { unsigned int i,j; for(i=0;iltitime;i++) for(j=0;jlt1275;j++); } lcdcmd(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); ...
    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); ...
    89c52 doesn't have spi, so i written it in software, but doesn't work. this is the code for writing data in to eeprom. please explain how to write it and correct the below code, if there is any error. i am trying to simulate in proteus. CODE: #include ltREGX51.Hgt #include ltintrins.hgt sbit sck = P2^0; sbit swr = P2^1; sbit srd = P2^2; void msdelay(unsigned int ms) { int i,j; for(i=ms;igt0;i--) for(j=122;jgt0;j--); } void write(unsigned int wdata) { int i; for(i=8;igt0;i--) { if((wdataamp0x80)gt0) ...
    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) { ...
    Hi, I am trying to interface AT93c56 EEPROM to 18F4550.i'm using MCC18 compiler. The EEPROM is wired for x8 configuration. The Problem with it is Every time I read EEPROM it returns 0xff only. My code is as below.. If any one knows the solution plz Help me.. #includeltp18f4550.hgt #includeltspi.hgt #define READ 0xc0 /* 1 10 A8 A7A6A5A4 A3A2A1A0 */ #define EWEN 0x98 /* 1 001 1XXX XXXX */ #define WRITE 0xa0 /* 1 01 A8 A7A6A5A4 A3A2A1A0 */ //#define READ 0x06 /* 1 10 A8 A7A6A5A4 A3A2A1A0 */ //#define EWEN 0x13 /* 1 001 1XXX XXXX */ //#define WRITE 0x05 /* 1 01 A8 A7A6A5A4 A3A2A1A0 */ #define lcd_data PORTD #define RS ...
    Build target 'Target 1' assembling STARTUP.A51... compiling Text1.c... TEXT1.C(1): warning C500: SERIAL NUMBER EXPIRED linking... BL51 BANKED LINKER/LOCATER V6.11 - SN: K1M9C-X6TNMH COPYRIGHT KEIL ELEKTRONIK GmbH 1987 - 2007 "STARTUP.obj", "Text1.obj" TO "delay" RAMSIZE(256) *** FATAL ERROR L210: I/O ERROR ON INPUT FILE: EXCEPTION 0021H: PATH OR FILE NOT FOUND FILE: Text1.obj Target not created why this type of eror so my code is CODE: #includeltREG51.hgt void msdelay(unsigned int); void main(void) { while(1) { P1=0x0f; msdelay(1000); P1=0x01; msdelay(1000); P1=0x02; msdelay(1000); P1=0x04; msdelay(1000); P1=0x08; msdelay(1000); } } void msdelay(unsigned int x) { unsigned int i,j; for(i=0;iltx;i++) for(j=0;jlt922;j++); }
    I saw this code in the book and i want to try it out but keil is giving me warnings...plz suggest me to solve the problem here is the code:- #include ltreg51.hgt sfr ldata = 0x90; sbit rs = P2^0; sbit rw = P2^1; sbit en = P2^2; sbit busy = P1^7; void main() { lcdcmd(0x38); lcdcmd(0x0E); lcdcmd(0x01); lcdcmd(0x06); lcdcmd(0x86); lcddata('M'); lcddata('D'); lcddata('E'); } void lcdcmd(unsigned char value) { lcdready(); ldata = value; rs = 0; rw = 0; en = 1; MSDelay(1); en = 0; return; } void lcddata(unsigned char value) { lcdready(); ldata=value; rs = 1; rw = 0; en = 1; MSDelay(1); en = 0; return; } void lcdready() { busy = 1; rs = 0; rw = 1; while(busy==1) { en = 0; MSDelay(1); en = 1; } return; } void MSDelay(unsigned int itime) { unsigned char i,j; for(i=0;iltitime;i++) for(j=0;jlt=1275;j++); } and i am getting these errors :- Build target 'Target 1' compiling lcd.c... lcd.c(9): warning C206: ...
    hi , i am trying to interface i2c protocol (da1307,24crom) with 8051 , even though the code is not covered underwhile(1){ } , it gets executed infinetly , wat is the problem , pLZ help me #include ltREGX51.hgt typedef unsigned int uint ; /* i2c function n data */ sfr port = 0x90; sbit scl = P3^7; sbit sda = P3^6; void starti2c(); void stopi2c(); void rominit(); void i2cwrite(uint); void i2cread(); void mdelay(); bdata uint data1; sbit msb = data1^7; sbit lsb = data1^0; /*lcd-----------------------*/ sbit en = P3^4; sbit rs = P3^5; void lcdinit(); void lcddata(unsigned int); void lcddatachar(unsigned char *); void lcdcmd(unsigned char); void bcdtoascii(unsigned int ); void msdelay(uint ); //-------------------------------- idata uint romwrite = 0xA0; idata uint romread = 0xA1; idata uint testdata = ...
    #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...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
    Hello I am having a problem in Calibrating the Frequency Counter. I've used Counter 0 16-bit mode. And I am actually recording values in TL0 and TH0 as the counter is run as then they are refreshed. The problem is that TL0 and TH0 gives the values in HEX, and I am not able to implement a formula to calibrate the value, since I cannot multiply or divide the HEX values that I get from the TL0 and TH0. Please advise me some technique in C-programming on how can I "combine" TH0 and TL0 values to get values in a single variable then how can ...
    The example code using keil and simulated using proteus CODE: #includeltregx51.hgt #includeltintrins.hgt sbit scl = P2^0; sbit sda = P2^1; void msdelay(unsigned char ms) { int i,j; for(i=0;ilt=ms;i++) for(j=0;jlt=6000;j++); } void sta() { sda = 1; scl = 1; _nop_(); sda = 0; _nop_(); scl = 0; } void stop() { sda = 0; scl = 1; msdelay(15); sda = 1; msdelay(10); } void ack() { sda = 1; scl = 1; F0 = 0; if(sda == 0) F0 = 1; scl = 0; _nop_(); } void mack() { sda = 0; scl = 1; _nop_(); scl = 0; } void mnack() { sda = 1; scl = 1; _nop_(); scl = 0; } char rdata() { unsigned char nn=0xff,mm=0x80,uu=0x7f; char j; sda=1; for(j=0;jlt8;j++) ...
    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 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 ...