Up thread ko lang po..
gusto ko lng po i-enhance yung ginawa kong timer...
24-hour setting po siya..
00:00:01 => 00:00:59
then, 00:01:00 => 00:59:59
then, 01:00:00 => 23:59:59 => 00:00:00
imbes na timer lang, gagawin ko na pong digital clock na naseset yung time. (hr/min/sec)..
pa-help naman po sa source code..
Yung timer din po, lalagyan ko rin sana ng switches para magreset at magstart ulit.
Paano po ba? Eto na po yung working schematic and source code:
Schematic:

Code:
#include <16f877.h>
#fuses XT,NOLVP,NOWDT,PUT
#use delay (clock=4000000) // defind crystal = 4MHz
#byte port_b=8
#byte port_c=5
byte CONST LED_MAP[10]={0x3F,0x06,0x5b,0x4F,0x66,0x6D,0x7D,0x07,0X7F,0x6F};
//===========================================
// this function use to display number 00=99
// input : n = number to display
//===========================================
void display_number(int32 n)
{
output_b(LED_MAP[n/36000%24]); //hour
output_low(PIN_C5);
delay_ms(1);
output_high(PIN_C5);
output_b(LED_MAP[n/3600%600]);
output_low(PIN_C4);
delay_ms(1);
output_high(PIN_C4);
output_b(LED_MAP[n/600%6]); //minutes
output_low(PIN_C3);
delay_ms(1);
output_high(PIN_C3);
output_b(LED_MAP[n/60%10]);
output_low(PIN_C2);
delay_ms(1);
output_high(PIN_C2);
output_b(LED_MAP[n/10%6]); //seconds
output_low(PIN_C1);
delay_ms(1);
output_high(PIN_C1);
output_b(LED_MAP[n%10]) ;
output_low(PIN_C0);
delay_ms(1);
output_high(PIN_C0);
}
//============================================
// main program
//============================================
main()
{
int32 i,count=0;
while(1)
{
for (i=0;i<=2;i++)
display_number(count); // dispay 200 times
count=(count==84600) ? 0: count+1;//count+1=++count
}
}