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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/19/06 20:36
Read: times


 
#114579 - thanks
Responding to: ???'s previous message
I'm not to sure about the chip, as far as i can see it is a philips 80c31 but i don't have it with me.

the program is the ksc system51 version 6.54 and this is the first time i use it as i have a little experience with pic programming in asm.

the code i used for the time subroutine is:

////////////////////////////////////////////////////////
<pre>
/* display */
unsigned char min1,min2,hour1,hour2,timeset,alarmset;
unsigned char alhour1,alhour2,almin1,almin2,once,stop;
void time()
{
clrscr(); // to clear the lcd

if(alarmset==0)
{
if (timeset==1)
{
sel_line(1); // to select the line on the lcd
Output("SET TIME");
}

if(sek>=60){min2++;sek=0;}
if(min2==10){min1++;min2=0;}
if(min1==6){hour2++;min1=0;}
if(hour2==10){hour1++;hour2=0;}
if(hour1==2){if(hour2==4){sek=0;min1=0;min2=0;hour1=0;hour2=0;}}
sel_line(2);

XMEM[0x6001] =hour1^48;
delay(1);
XMEM[0x6001] =hour2^48;
delay(1);
Output(":");
XMEM[0x6001] =min1^48;
delay(1);
XMEM[0x6001] =min2^48;
delay(1);

}

sel_line(1);
if (alarmset==1)
{
Output("SET ALARM");
sel_line(2);
XMEM[0x6001] =alhour1^48;
delay(1);
XMEM[0x6001] =alhour2^48;
delay(1);
Output(":");
XMEM[0x6001] =almin1^48;
delay(1);
XMEM[0x6001] =almin2^48;
delay(1);
}

}
<\pre>
////////////////////////////////////////////////////



List of 6 messages in thread
TopicAuthorDate
clock            01/01/70 00:00      
   program            01/01/70 00:00      
   I applaud - someone will help you I'm su            01/01/70 00:00      
      thanks            01/01/70 00:00      
   Need full picture            01/01/70 00:00      
   While loop            01/01/70 00:00      

Back to Subject List