caramoan tour package

caramoan tour package

Author Topic: pa2long naman po sa clock with stopwatch  (Read 401 times)

Offline sonic05

  • CR2032 Battery
  • **
  • Posts: 30
  • Pogi/Ganda Points: 2
pa2long naman po sa clock with stopwatch
« on: October 03, 2010, 05:30:54 PM »
http://drop.io/e2_po

ayan po ung schematic nya ung 1st po bli ung ginawa q pero common cathode po ginamit q and binase q naman po ung connection ng transistor dun sa second schematic po...



e2 po ung program ng clock at ung balak q po sana gumawa ng clock na pwede ring maging stopwatch pero d q naman po alam kung pano gagawin at isisingit d2 sa program please pa2long naman po...na kapag pinindot ung switch na idadagdag dun lang po sana mag rurun ung stopwatch,.



#include <16F877A.h>
#fuses XT,NOWDT,PUT,NOBROWNOUT,NOLVP
#use delay(clock = 40000000)
#byte PORTA=0X05
#byte PORTC=0x07
#byte PORTB=0X06
#define A0 PIN_A0
#define A1 PIN_A1
#define A2 PIN_A2
#define A3 PIN_A3
#define A4 PIN_A4


int sec1,sec2,min1,min2,hour1,hour2;
int num1=5,num2=5,num3=5;

int counter=125;
int flag=0;


const int table[10]={0b00111111,
0b00000110, 
0b01011011, 
0b01001111,   
0b01100110, 
0b01101101,   
0b01111101, 
0b00000111,   
0b01111111, 
0b01101111}; 

void main()
{
PORTB=0X00;
PORTC=0X00;


set_tris_a(0xff);
set_tris_c(0x00);
set_tris_b(0x00);
set_RTCC(6);
setup_counters(RTCC_INTERNAL,RTCC_DIV_32);
enable_interrupts (INT_RTCC);
enable_interrupts (GLOBAL);

for(;Wink
{
PORTB=table[sec1];
PORTC=0X01;
delay_ms(3);

PORTB=table[sec2];
PORTC=0x02;
delay_ms(3);

PORTB=table[min1];
PORTC=0x04;
delay_ms(3);

PORTB=table[min2];
PORTC=0x08;
delay_ms(3);

PORTB=table[hour1];
PORTC=0x10;
delay_ms(3);

PORTB=table[hour2];
PORTC=0x20;
delay_ms(3);



if(flag==1){


flag=0;
}





 if(input(A4)==1)
                          {
                        disable_interrupts(INT_RTCC);

                      if(input(A2)==1) { --num1; }
                      if(num1==0){
                           if(++min1>9) {
                                       min1=0;
                                if(++min2>5) {  min2=0; }
                                          }
                                        num1=5;
                                        }
                      if(input(A3)==1){ --num2; }
                                 
                               if(num2==0) {
                                     if( ++hour1>9 )
                                                     {                                                         
                                                  hour1=0;
                                                 ++hour2;
                                                      }
                                     if( (hour2==1) & (hour1==3) )  {
                                                              hour1=1;
                                                               hour2=0;
                                                                    }
                                                       num2=5;                     
                                              }
                     if(input(A1)==1) { --num3; }
                      if(num3==0){
                           if(++sec1>9) {
                                       sec1=0;   
                                if(++sec2>5) {  sec2=0; }
                                          }
                                        num3=5;         
                                        }
                          }


                    else if(input(A4)==0){
                                enable_interrupts(INT_RTCC);
                                        }
}

}

#int_RTCC
void microII()

{ //void switch_time();
if(--counter>0)return;
counter=125;
flag=1;


if(++sec1>9){
sec1=0;

if(++sec2>5){
sec2=0;

if(++min1>9){
min1=0;

if(++min2>5){
min2=0;
if( ++hour1>9 )
{
hour1=0;
++hour2;
}
if( (hour2==1) & (hour1==3) ) {
sec1=0;
sec2=0;
min1=0;
min2=0;
hour1=1;
hour2=0;
}


}
}
}
}


}

Philippine Electronics Forum

pa2long naman po sa clock with stopwatch
« on: October 03, 2010, 05:30:54 PM »

Offline marcelino

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6016
  • Pogi/Ganda Points: 258
  • ...keep moving forward! - Robinson's
Re: pa2long naman po sa clock with stopwatch
« Reply #1 on: October 03, 2010, 07:22:23 PM »
first glance,

#use delay(clock = 40000000)

maybe

#use delay(clock = 4000000)
"Don't take life seriously. After all, no one has ever come out of it alive. -Bugs Bunny"

Philippine Electronics Forum

Re: pa2long naman po sa clock with stopwatch
« Reply #1 on: October 03, 2010, 07:22:23 PM »

Offline sonic05

  • CR2032 Battery
  • **
  • Posts: 30
  • Pogi/Ganda Points: 2
Re: pa2long naman po sa clock with stopwatch
« Reply #2 on: October 03, 2010, 07:28:50 PM »
opo cge po...

Philippine Electronics Forum

Re: pa2long naman po sa clock with stopwatch
« Reply #2 on: October 03, 2010, 07:28:50 PM »

Offline sonic05

  • CR2032 Battery
  • **
  • Posts: 30
  • Pogi/Ganda Points: 2
Re: pa2long naman po sa clock with stopwatch
« Reply #3 on: October 03, 2010, 07:47:56 PM »
satingin nyo ?? kakayanin po ba??

Philippine Electronics Forum

Re: pa2long naman po sa clock with stopwatch
« Reply #3 on: October 03, 2010, 07:47:56 PM »

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: pa2long naman po sa clock with stopwatch
« Reply #4 on: October 03, 2010, 08:38:46 PM »
   SPAM ba 'to ?
mas ok sana kung naka-upload din mismo yung proteus file.. :)
and hi-tech C compiler ang gagamitin.
anong gamit mong crystal?

also, use [ code]  ... [/ code ] for your source codes
Code: [Select]
//your code here

:)
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Philippine Electronics Forum

Re: pa2long naman po sa clock with stopwatch
« Reply #4 on: October 03, 2010, 08:38:46 PM »

Offline sonic05

  • CR2032 Battery
  • **
  • Posts: 30
  • Pogi/Ganda Points: 2
Re: pa2long naman po sa clock with stopwatch
« Reply #5 on: October 03, 2010, 09:13:19 PM »
sorry po newbie lang po aq...

Offline sonic05

  • CR2032 Battery
  • **
  • Posts: 30
  • Pogi/Ganda Points: 2
Re: pa2long naman po sa clock with stopwatch
« Reply #6 on: October 03, 2010, 09:20:19 PM »
d po kc sya gumagana sa ISIS po eh in actual lang po talaga d q po alam kung bakit and ang gamit ko pong crystal ay TIC 4.000D po

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: pa2long naman po sa clock with stopwatch
« Reply #7 on: October 03, 2010, 09:45:15 PM »
dun sa inupload mong original diagram,
gumamit sila ng 6.5536MHz xtal, kaya nakakagenereate sila ng accurate ng clock source.
hindi magandang alternative yang ginagamit mong crystal na 4MHz.
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline sonic05

  • CR2032 Battery
  • **
  • Posts: 30
  • Pogi/Ganda Points: 2
Re: pa2long naman po sa clock with stopwatch
« Reply #8 on: October 03, 2010, 10:05:23 PM »
pero tama naman po ung bilis ng second nya...please help naman po sa pag build ng clock with stopwatch...

Offline sonic05

  • CR2032 Battery
  • **
  • Posts: 30
  • Pogi/Ganda Points: 2
Re: pa2long naman po sa clock with stopwatch
« Reply #9 on: October 04, 2010, 06:35:12 PM »
[ code]...[/ code ]

testing

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: pa2long naman po sa clock with stopwatch
« Reply #10 on: October 04, 2010, 08:33:03 PM »
^ remove the "spaces" :)
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Philippine Electronics Forum

Re: pa2long naman po sa clock with stopwatch
« Reply #10 on: October 04, 2010, 08:33:03 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com