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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/03/05 11:24
Read: times


 
#84254 - WriteCommandLCD ?
Responding to: ???'s previous message
Shahzad said:
void main(void)
{
   TMOD |= 0x01;
   ET0 = 0;

   Simple_Delay_N_Fifty(10);

   z = IsLeapYear(2004);
   if(z == 1)
   {
      WriteCommandLCD(0x20, 1);  //execute command
      WriteCommandLCD(0x0F, 1);  //execute command
   }

   while(1)
   {
      speakerRoutine(10,5);
   }
}

int IsLeapYear( int y )
{
   if( ((y % 4) == 0) && ((y % 100) != 0) || ((y % 400) == 0) )
      return( 1 );
   else
      return( 0 );
}

How do you know that the problem lies in IsLeapYear() rather than WriteCommandLCD() ?

WriteCommandLCD() will rely upon real interactions with your real hardware - precisely the sort of area where probkems may not show up in Simulation!

  • What did you use in place of WriteCommandLCD() when running under Turbo-C?
  • What did you use in place of WriteCommandLCD() when running in the Keil Simulator?
  • How have you tested WriteCommandLCD() in the real hardware?

    What happens if you make a "dummy" IsLeapYear() like this:
    int IsLeapYear( int y )
    {
       return 1;
    }
    Does it still hang?


  • List of 25 messages in thread
    TopicAuthorDate
    Keil C Code not working            01/01/70 00:00      
       Desktop turbo c++ ?            01/01/70 00:00      
          Slightly??!!            01/01/70 00:00      
          agreed            01/01/70 00:00      
             i got the math to do div / multiply            01/01/70 00:00      
             Debugger? Simulator? Maths?            01/01/70 00:00      
                Question...            01/01/70 00:00      
                   Please use Correct Terms            01/01/70 00:00      
                Re Andy Debugger, Simulator? Math            01/01/70 00:00      
             *unnecessarily* complex!            01/01/70 00:00      
                Re andy            01/01/70 00:00      
                   Divide and Conquer!            01/01/70 00:00      
             Bad Burner?            01/01/70 00:00      
                Re Andy Bad Burner            01/01/70 00:00      
             Project Configuration?            01/01/70 00:00      
       debugging?            01/01/70 00:00      
          thanks for the link            01/01/70 00:00      
       Data Sizes - Lesson not yet learned?            01/01/70 00:00      
          Re Andy            01/01/70 00:00      
       brackets ?            01/01/70 00:00      
          (no) brackets            01/01/70 00:00      
       WriteCommandLCD ?            01/01/70 00:00      
          Re Andy            01/01/70 00:00      
             Problem not fixed yet?            01/01/70 00:00      
                Problem not fixed yet?            01/01/70 00:00      

    Back to Subject List