This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

tracing out register values

how to trace the register values in a program using keil debug session

Parents
  • i could not understand your program about what kind of option you are trying to use
    but here it is my program execute it it will work.in this program you need to adjust the time value,then i hope it will work as nice clock...

    ;port p1 for sevent segmet data and p3 for multplexing four seven segment LED
    
                            ORG 00H                                         ;As using interrupt jump to general purpose starts at 30h
                            LJMP MAIN                                       ; jump to main program
                            ORG 0BH                                         ;timoer 0 interrupt serice vector
                            LJMP prog                                       ;jump to execute the necessary condition on ehalf of timer interrupt 0
                            ORG 30H                                         ;start of general purpose ram
                            MOV R2,#0                                       ;initializing r2,r3,r4,r5 as we are usin four digit
                            MOV R3,#0                                       ;
                            MOV R4,#0                                       ;
                            MOV R5,#0                                       ;
                            MOV A,#0
    MAIN:           MOV TMOD,#00000001B                     ;timer 0 mode
                            MOV IE,#10000010B                       ;timer 0 interrupt enabling
                            MOV TH0,#0H                                     ;actually timer must be initialzed for 60 seconds but here i ve used an approximate value
                            MOV TL0,#01H                            ;
                            SETB TR0                                        ;timer run
                            MOV DPTR,#DAT
    L1:                     MOV P3,#00000001H                       ;actally you need to show the time by using LED know,to make all the LED glow for appropriate time
                            MOV R0,#46H                                     ;copying from the required memory location
                            MOV A,@R0                                       ;copyig from r0 to a
                            MOVC A,@A+DPTR
                            MOV P1,A                                        ; copying from a to p1
    
                            MOV P3,#00000010B
                            MOV R0,#47H
                            MOV A,@R0
                            MOVC A,@A+DPTR
                            MOV P1,A
    
                            MOV P3,#00000100B
                            MOV R0,#48H
                            MOV A,@R0
                            MOVC A,@A+DPTR
                            MOV P1,A
    
                            MOV P3,#00001000B
                            MOV R0,#49H
                            MOV A,@R0
                            MOVC A,@A+DPTR
                            MOV P1,A
                            SJMP L1
    
    
    prog:           MOV TH0,#00H                                    ; again timer setup
                            MOV TL0,#01H
                            CLR TF0
                            SETB TR0
                            INC R2
                            MOV R1,#46H
                            MOV A,R2
                            MOV @R1,A
                            CJNE R2,#10,L2
                            MOV R2,#0
                            INC R3
                            MOV R1,#47H
                            MOV A,R3
                            MOV @R1,A
                            CJNE R3,#10,L2
                            MOV R3,#0
                            INC R4
                            MOV A,R4
                            MOV R1,#48H
                            MOV @R1,A
                            CJNE R4,#10,L2
                            MOV R4,#0
                            INC R5
                            MOV R1,#48H
                            MOV A,R5
                            MOV @R1,A
                            CJNE R5,#10,L2
                            MOV R2,#0
                            MOV R3,#0
                            MOV R4,#0
                            MOV R5,#0
    
    L2:                     RETI
    
    
    DAT:            DB   0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,98H
    
                            END
    

Reply
  • i could not understand your program about what kind of option you are trying to use
    but here it is my program execute it it will work.in this program you need to adjust the time value,then i hope it will work as nice clock...

    ;port p1 for sevent segmet data and p3 for multplexing four seven segment LED
    
                            ORG 00H                                         ;As using interrupt jump to general purpose starts at 30h
                            LJMP MAIN                                       ; jump to main program
                            ORG 0BH                                         ;timoer 0 interrupt serice vector
                            LJMP prog                                       ;jump to execute the necessary condition on ehalf of timer interrupt 0
                            ORG 30H                                         ;start of general purpose ram
                            MOV R2,#0                                       ;initializing r2,r3,r4,r5 as we are usin four digit
                            MOV R3,#0                                       ;
                            MOV R4,#0                                       ;
                            MOV R5,#0                                       ;
                            MOV A,#0
    MAIN:           MOV TMOD,#00000001B                     ;timer 0 mode
                            MOV IE,#10000010B                       ;timer 0 interrupt enabling
                            MOV TH0,#0H                                     ;actually timer must be initialzed for 60 seconds but here i ve used an approximate value
                            MOV TL0,#01H                            ;
                            SETB TR0                                        ;timer run
                            MOV DPTR,#DAT
    L1:                     MOV P3,#00000001H                       ;actally you need to show the time by using LED know,to make all the LED glow for appropriate time
                            MOV R0,#46H                                     ;copying from the required memory location
                            MOV A,@R0                                       ;copyig from r0 to a
                            MOVC A,@A+DPTR
                            MOV P1,A                                        ; copying from a to p1
    
                            MOV P3,#00000010B
                            MOV R0,#47H
                            MOV A,@R0
                            MOVC A,@A+DPTR
                            MOV P1,A
    
                            MOV P3,#00000100B
                            MOV R0,#48H
                            MOV A,@R0
                            MOVC A,@A+DPTR
                            MOV P1,A
    
                            MOV P3,#00001000B
                            MOV R0,#49H
                            MOV A,@R0
                            MOVC A,@A+DPTR
                            MOV P1,A
                            SJMP L1
    
    
    prog:           MOV TH0,#00H                                    ; again timer setup
                            MOV TL0,#01H
                            CLR TF0
                            SETB TR0
                            INC R2
                            MOV R1,#46H
                            MOV A,R2
                            MOV @R1,A
                            CJNE R2,#10,L2
                            MOV R2,#0
                            INC R3
                            MOV R1,#47H
                            MOV A,R3
                            MOV @R1,A
                            CJNE R3,#10,L2
                            MOV R3,#0
                            INC R4
                            MOV A,R4
                            MOV R1,#48H
                            MOV @R1,A
                            CJNE R4,#10,L2
                            MOV R4,#0
                            INC R5
                            MOV R1,#48H
                            MOV A,R5
                            MOV @R1,A
                            CJNE R5,#10,L2
                            MOV R2,#0
                            MOV R3,#0
                            MOV R4,#0
                            MOV R5,#0
    
    L2:                     RETI
    
    
    DAT:            DB   0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,98H
    
                            END
    

Children
No data