| ??? 02/23/03 03:10 Read: times |
#39814 - Final Clock Codes using Timers only |
Hello all,
As you all know that iam trying to work out a simple digital clock using 89c52 controller without interrupts. Now sir at this moment please consider that Interrupts do not exist...... and we can only use timers and other commands but no interrupts....( as i want to make the clock without using interrupts , its possible in my opinion although we have to write too many checks in the program)... Also 8051 is also not avaiable in my place..so using 89c52 1) Connecting 8 wires from Port 1 to Four 74LS373 input pins in parallel fashion and from the out put of 74LS373 connecting wires to 7-segment display pins. 2) Then connecting the Crystal circuitary using two 30 Pico farad capacitors and crystal 12 MHz. to pin 18 and 19. 3) Then connecting the rest circuitary using a mannual button , 100 Ohms Resistors, 10 uf 16 V capacitor, 8.2 Ohms Resistor... reference from Scott Machzine book. Now i have conplete the hardware... now comes the difficult part , please check my approach :- Lets say that :- the clock starts from 12:00 clock. so iam placing the values as R3 register is for 7-segment digit which will present or show 1 R2 register is for 7-segment digit which will present or show 2 R1 register is for 7-segment digit which will present or show 0 R0 register is for 7-segment digit which will present or show 0 MAIN: CPL P2.0 MOV A,R0 CALL DISPLAY CPL P2.0 CPL P2.1 MOV A,R1 CALL DISPLAY CPL P2.1 CPL P2.2 MOV A,R2 CALL DISPLAY CPL P2.2 CPL P2.3 MOV A,R3 CALL DISPLAY CPL P2.3 DISPLAY: ZERO: CJNE A,#00H,ONE MOV P1, #3FH ONE: CJNE A,#00H,TWO MOV P1, #06H and so one but i have to bring a check when ever the clock reaches the value of 12:59 so that it resets to 1:00 then i have to certain more adjust to keep the time going.. is it ok or is this method would not the make the clock, but it may be a simple number display. actually the tutorial you here about interrupt is very good but i think it is my dum head that is unable to understand how to use these for my case. |



