OpenCores
URL https://opencores.org/ocsvn/8051/8051/trunk

Subversion Repositories 8051

[/] [8051/] [tags/] [rel_12/] [asm/] [counter_test.asm] - Diff between revs 2 and 131

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 131
Line 5... Line 5...
; r4: counter low expected value
; r4: counter low expected value
; r5: owerflov counter expected value
; r5: owerflov counter expected value
 
 
        ajmp start;
        ajmp start;
 
 
        .org 03h        ;external interrupt 0
        org 03h         ;external interrupt 0
        reti;
        reti;
 
 
        .org 0bh        ;t/c 0 interrupt
        org 0bh         ;t/c 0 interrupt
        inc r0;
        inc r0;
        reti;
        reti;
 
 
        .org 13h        ;external interrupt 1
        org 13h         ;external interrupt 1
        reti;
        reti;
 
 
        .org 1bh        ;t/c 1 interrupt
        org 1bh         ;t/c 1 interrupt
        inc r1;
        inc r1;
        reti;
        reti;
 
 
        .org 23h        ;serial interface interrupt
        org 23h         ;serial interface interrupt
        reti;
        reti;
 
 
 
 
test0:
test0:
        mov a, th0      ;
        mov a, th0      ;
Line 51... Line 51...
        mov a, r1       ;
        mov a, r1       ;
        subb a, r5      ;
        subb a, r5      ;
        jnz error       ;
        jnz error       ;
        ret;
        ret;
 
 
 
wait:
 
        dec a           ; 1
 
        nop             ; 1
 
        nop             ; 1
 
        nop             ; 1
 
        nop             ; 1
 
        nop             ; 1
 
        nop             ; 1
 
        nop             ; 1
 
        nop             ; 1
 
        nop             ; 1
 
        jnz wait        ; 2
 
        reti            ; 4
 
 
 
 
error:
error:
        mov p0, r2;
        mov p0, r2;
        nop;
        nop;
        ajmp error;
        ajmp error;
Line 273... Line 287...
        acall test0     ;
        acall test0     ;
 
 
        mov tl0, #000h  ; load counter 0
        mov tl0, #000h  ; load counter 0
        mov th0, #000h  ;
        mov th0, #000h  ;
        setb tcon.6     ; start counter 1
        setb tcon.6     ; start counter 1
 
        mov a, #03h     ;
 
        acall wait      ;
 
        nop;
        nop;
        nop;
        nop;
        nop;
        nop;
        nop;
        clr tcon.6      ; stop counter 1
        clr tcon.6      ; stop counter 1
        mov r2, #0b0h   ;
        mov r2, #0b0h   ;
Line 286... Line 303...
        acall test0     ;
        acall test0     ;
 
 
        mov tl0, #000h  ; load counter 0
        mov tl0, #000h  ; load counter 0
        mov th0, #0fch  ;
        mov th0, #0fch  ;
        setb tcon.6     ;start counter 1
        setb tcon.6     ;start counter 1
        nop;
        mov a, #05h     ;
 
        acall wait      ;
        nop;
        nop;
        nop;
        nop;
        nop;
        nop;
        nop;
        nop;
        clr tcon.6      ;stop counter 1
        clr tcon.6      ;stop counter 1
        mov r2, #0c0h   ;
        mov r2, #0c0h   ;
        mov r3, #002h   ;
        mov r3, #003h   ;
        mov r4, #000h   ;
        mov r4, #000h   ;
        mov r5, #001h   ;
        mov r5, #001h   ;
        mov r0, 01h     ;
        mov r0, 01h     ;
        acall test0     ;
        acall test0     ;
 
 
Line 504... Line 522...
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
 
 
 
 
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        cpl p3.6;
        clr tcon.6      ;stop counter 1
        clr tcon.6      ;stop counter 1
        mov r2, #0a8h   ;
        mov r2, #0a8h   ;
Line 517... Line 536...
        acall test1     ;
        acall test1     ;
 
 
        mov p0, #002h   ; test counter 1 done!
        mov p0, #002h   ; test counter 1 done!
 
 
 
 
 
end
end
end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.