Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

digital clock HELP..!!!(reading and displaying time)

Status
Not open for further replies.

myhumps007

Newbie level 6
Joined
Dec 8, 2010
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,362
View attachment cl.bmpView attachment cl.bmp
hi...im making a digital clock using DS12887 and at89c52.
I just wrote time reading and displaying code...
i wanted to display on 7-segment(comon cathode) using BCD decoders(4511).
i test my circuit for seconds..they are working fine but for minutes and hours,it is malfunctioning on displays...(schematic attached).
plz help...!!!!1
HERE IS the CODE:
#include <reg51.h>
#include<absacc.h>
void init(void);
void MSDelay(unsigned int);
unsigned char hr,min,sec;
void main(void)
{
MSDelay(200);
XBYTE[10]=0x20;
XBYTE[11]=0x83; //bcd,24hrs,dse
XBYTE[0]=0x55;//55sec
XBYTE[2]=0x58; //58min
XBYTE[4]=0x16; //16hr :19.58.55
XBYTE[7]=0x19; //27
XBYTE[8]=0x10; //12
XBYTE[9]=0x04; //10/04/2003
XBYTE[11]=0x03;
TMOD=0x20;
TH1=0xFD; //9600 baud rate
SCON=0x50;
TR1=1;
while(1)
{
hr = XBYTE[4]; //get hour---this is not showing fine on P1,same for minutes
P1=hr;
min = XBYTE[2]; //get min
//P1=min;
sec=XBYTE[0];//get sec---ok for seconds
//P1=sec;
}
}

void MSDelay(unsigned int itime){
unsigned int i,j;
for (i=0;i<itime;i++)
for (j=0;j<1275;j++);
}
 

The easy way is to observe ur project and in each 2 or three mins , jump or skip some secs then it will be all right
also no need for ds12''' , INSTEAD u can use directly crystal and multiplexed display with ordinary mcu without binary coded decimal
display drivers. All can be in code,Try this to be in lowest parts count and most effiecient programming
THAT'S THE BEAUTY OF EMBEDDED APPLICATIONS.
 
thnx for ur reply dear...
but i hv to use DS12887.dats da req
how can i skip secs????
and how can i use direct multiplex display???
plzz help me.....solve atleast dats display problem mentiooned earlier.....
wen i display hours...it strts dhowing mins and secs in betwee...
i hv tried solve but i cant..plz help.
 

pls check this **broken link removed**.. this will certainly help.
 

the whole rotuine is skewed in RT by adding 200ms at the first and subsiquent steps

...

listen to synconicity in the world and not code sync
remember a micro adhears to sync time unless you skew its main routines by addins a delay
based on nop's {no opperations} as a delay command is..

delay = as many nops ...
 

start__ clear ram for sec min and hour __then go for ds chip__start mux.ing_
now in delay of muxing display_________go for ds chip__continue muxing
when sec=59 and ds ticks
sec 0 add min
__when min=59 and sec also 59 and then you have tick
add hour

calib portion is when u r using crystal
__check the time for some mins and write down the error
now re code ur flow with add or sub some time offset
after every some time passed


in ur ds type conversate with it in
free time when we switches display
THIS IS ONE RULE WHILE DISPLAYING 7 SEG
RUN UR CODE IN THE SWITCHING LATCHES
HOPE U GET IT
 
Last edited:

the funny thing with quarts is at its core ie atoms
it all beets or tries to at the same incrum

so all quarts will all sync together at 0 ticks as close to its resonace point

all over the world

afterall atoms are atoms

do not skew time when you begin a main ... do

before fine
... the mcu will have to wait till its next non nop cycle state of 4 banks or less {pic etc}
 

all u guys r right...
i hv theze concepts but im not able to implement thru code..........
plzz plzz plzz,if u could help me in my code..i would b really glad..
 

rajat....u getting me wrong,
i just want this reading error to b clear...
i hv tried but coul;dnt find solutoin dear....
 

actually i don't know what ur inc files contain
but seriously
assemble watch with mcu is simply easy task
just consider secs calibration correctly
and go for rx tx at (interrupts/// or at mux display waits)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top