 Artog (18.08.2005 16:10, просмотров: 1595)
 Artog (18.08.2005 16:10, просмотров: 1595)
AT89S8253 - не работает Timer1 в  качестве baud rate Ниже приведен код, который работает на AT89S8252, но не работает на AT89S8253. Выдержка из даташита:
One can achieve very low baud rates with Timer 1 by leaving the Timer 1 interrupt enabled, and configuring the Timer to run as a 16-bit timer (high nibble of TMOD = 0001B), and using the Timer 1 interrupt to do a 16-bit software reload.
Код:
        ORG     0000H
        JMP     BEGIN
        ORG     001BH
        JMP     TM1INT
        ORG     0023H
        JMP     SRLINT
        ORG     0100H
BEGIN:
        MOV     SCON,#50H
        MOV     TMOD,#10H
        MOV     TH1,#0CFH            ;baud rate is equal to 5 baud
        MOV     TL1,#2CH
        ORL     PCON,#10000000B  ;SMOD1=1
        SETB    ES                 ;Enable serial interrupt
        SETB    ET1
        SETB    EA                 ;Enable global interrupt
        SETB    TR1               ;Timer 1 run
        MOV     SBUF,#55H
        JMP $
TM1INT:
        CLR     TR1
        MOV     TH1,#0CFH
        MOV     TL1,#2CH
        SETB    TR1
        RETI
SRLINT:
        ;JNB     TI,TI_NINT
        CLR     TI
        MOV     SBUF,#55H
TI_NINT:
        RETI
end
Может кто чего подскажет?