Peter thank you again i tried his code and its working except the hrs timer. Its not incrementing right i just have to keep looking at it. Mike Johnston ----- Original Message ----- From: "Peter L. Peres" To: Sent: Monday, May 13, 2002 11:03 AM Subject: Re: a 16c54 clock desigin. > On Sun, 12 May 2002, Michael Johnston wrote: > > >peter > >thanks for the code example I havent tried it yet but will give it try > >Ive been tryin to get this going for quite a while. > >thanks again > >mike johnston > >----- Original Message ----- > >From: "Peter L. Peres" > >To: > >Sent: Tuesday, May 07, 2002 4:26 PM > >Subject: Re: a 16c54 clock desigin. > > > > > >> Try (untried code!): > >> > >> again: > >> ; do something intelligent with the time here, like display it f. ex. > >> > >> btfsc PORTA,3 ; if it's still 1 from last time wait till it's 0 > >> goto ($-1) > >> > >> btfss PORTA,3 ; wait for rising edge of clock > >> goto ($-1) > >> > >> incf Fseconds,f > >> addlw (.256-.60) ; set C if >= 60 > >> btfss STATUS,C > >> goto again > ... > > this code won't work, the second posting (adds movf Fxxx,w before the > addlw instructions, will, if and only if you add a loop to count the 60Hz > signal down to 1Hz, which I did not show. > > Andy Warren posted code that should work. > > Peter > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.