Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/06/08 14:17
Read: times


 
#159840 - something weird
Responding to: ???'s previous message
sir ,actually instead of showing the RPM it was acting as a counter i.e when the disc mounted on shaft of the motor was run in betwen the sensor moc7811 the display was showing 1,2,3......9 and then garbage values which were indicating that at the i/p of 7447 there was invalid bcd coming.
i also loaded the uc with a simple program of displaying and it was working fine,also the code was changed as follows and showing correct o/p on KEIL but couldn't figure out what's the problem and also i was falling short of time and hence submited as it was..

#include<reg52.h>
void main()
{


int A,B,x;
int ones,tens,hundreds,temp;

TMOD=0x15;
P3=0xFF;
TL0=0;
TH0=0;

TL1=0xFC;
TH1=0xEF;
TR0=1;
TR1=1;

while(TF1==0)
{;
}
TF1=0;
TR1=0;
A=TL0;
B=0x0C; //SINCE ABOVE PROGRAM WILL COUNT NO OF REV IN 5SEC
temp=A*B; //TO CALCULATE RPM MULTIPLY WITH 12SEC

while(temp>=0)
{
temp-=100;
hundreds++;
}
hundreds--;
temp+=100;
while(temp>=0)
{
temp-=10;
tens++;
}
tens--;
temp+=10;
ones=temp;
x=tens*16+ones;
P0=x;
P2=hundreds;


}

List of 27 messages in thread
TopicAuthorDate
tachometer            01/01/70 00:00      
   schematic, please            01/01/70 00:00      
      Datasheet?            01/01/70 00:00      
      reply to tachometer            01/01/70 00:00      
         Resistor to processor too.            01/01/70 00:00      
            the schematic is            01/01/70 00:00      
               Limitation of base current to 2N2222?            01/01/70 00:00      
               in effect            01/01/70 00:00      
   another option            01/01/70 00:00      
      What is your part in this assignment?            01/01/70 00:00      
   thanks            01/01/70 00:00      
      Don't panic            01/01/70 00:00      
      RE: dont have enough knowledge on microcontrollers            01/01/70 00:00      
   CODE            01/01/70 00:00      
   expecting a reply now            01/01/70 00:00      
      Not BCD!            01/01/70 00:00      
         how to solve?            01/01/70 00:00      
            your task            01/01/70 00:00      
               trying!!            01/01/70 00:00      
   not found !!!!            01/01/70 00:00      
      Trivial solution: compare/subtract            01/01/70 00:00      
         thanks a lot!!!            01/01/70 00:00      
            google or paper and pen            01/01/70 00:00      
   something weird            01/01/70 00:00      
      treading dangerous waters            01/01/70 00:00      
      Nothing weird            01/01/70 00:00      

Back to Subject List