Thông báo

Collapse
No announcement yet.

Giúp đoạn code đông hồ

Collapse
X
 
  • Lọc
  • Giờ
  • Show
Clear All
new posts

  • Giúp đoạn code đông hồ

    Mình có đoạn code đồng hồ nhưng đã chạy tốt nhưng nó thiếu phần ngõ ra xung 1s tại chân số 7 của DS1307(sout). Mình không biết thêm vào đoạn code nhưng gì, bạn nào biết thì chỉ giúp mình. Thanks nhiều


    code:

    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
    ;XXXXXXXXXXXXXXXXXX CHUONG TRINH DING HO SO XXXXXXXXXXXXXXXXXXX
    ;XXXXXXXXXXXXXXXXXXXXXXX GIO-PHUT-GIAY XXXXXXXXXXXXXXXXXXXXXXXX
    ;XXXXXXXXXXXXXXXXXXXXXX NGAY- THANG-NAM XXXXXXXXXXXXXXXXXXXXXXX
    ;XXXXXXXXXXXXXXXXXXXXX NGUYEN MINH THANH XXXXXXXXXXXXXXXXXXXXXX
    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXX
    ORG 0000H
    JMP MAIN
    SCL BIT P1.0
    SDA BIT P1.1
    MODE BIT P3.0
    TANG BIT P3.1
    GIAM BIT P3.2
    HENGIO BIT P3.3
    GIAY BIT 28H.0
    PHUT BIT 28H.1
    GIO BIT 28H.2
    NGAY BIT 28H.3
    THANG BIT 28H.4
    NAM BIT 28H.5
    KIEMTRA BIT 29H.0
    TT BIT 29H.1
    DIACHI EQU 30H
    DULIEU EQU 32H
    DULIEUND EQU 33H
    DULIEUNC EQU 34H
    DULIEUTD EQU 35H
    DULIEUTC EQU 36H
    DEMS EQU 40H
    DEMP EQU 41H
    DEMH EQU 42H
    DEMN EQU 43H
    DEMT EQU 44H
    DEMND EQU 45H
    TAM2 EQU 49H
    DEMNDD EQU 55H
    DEMNDC EQU 56H
    DEMNCD EQU 57H
    DEMNCC EQU 58H
    DEMP1 EQU 59H
    DEMH1 EQU 60H
    DEMP1D EQU 61H
    DEMP1C EQU 62H
    DEMH1D EQU 63H
    DEMH1C EQU 64H
    DEM EQU 65H
    ORG 030H
    ;################################################# ###############
    ;################### CHUONG TRINH CHINH #####################
    ;################################################# ###############

    MAIN:

    CLR P3.7
    MOV P0,#0FFH
    MOV DPTR,#LED7ANODE
    MOV DEMS,#00
    MOV DEMP,#00
    MOV DEMH,#00
    MOV DEMND,#11
    MOV DEMN,#00
    MOV DEMT,#00
    MOV DEMH1,#00
    MOV DEMP1,#00
    ;################################################# ################
    ;##################### HIEN THI LED 7 DOAN #####################
    ;################################################# ################
    CALL NHANTHOIGIAN
    CLR P3.7
    CLR TT
    CLR KIEMTRA
    HIENTHILED7DOAN:
    CALL NHANTHOIGIAN
    CALL QUETLED7DOAN
    BAOTHUC:
    JNB KIEMTRA,KIEMTRAMODE
    SETB P3.7
    JB MODE,KIEMTRAMODE
    CALL T50Ms
    JNB MODE,$
    CLR P3.7
    CLR TT
    CLR KIEMTRA
    JMP HIENTHILED7DOAN
    KIEMTRAMODE:
    JB MODE,X
    CALL T50Ms
    JNB MODE,$
    JMP CHINHTHOIGIAN
    X:
    JB HENGIO,KIEMTRA1
    CALL T50Ms
    JNB HENGIO,$
    JMP HENGIO1
    ;################################################# ################
    ;################################################# ################
    ;#################### BAO THUC ####################
    ;################################################# ################
    KIEMTRA1:
    JNB TT,HIENTHILED7DOAN
    MOV A,R5
    CJNE A,DEMH1C,HIENTHILED7DOAN
    CALL NHANTHOIGIAN
    CALL QUETLED7DOAN
    MOV A,R4
    CJNE A,DEMH1D,HIENTHILED7DOAN
    CALL NHANTHOIGIAN
    CALL QUETLED7DOAN
    MOV A,R3
    CJNE A,DEMP1C,HIENTHILED7DOAN
    CALL NHANTHOIGIAN
    CALL QUETLED7DOAN
    MOV A,R2
    CJNE A,DEMP1D,HIENTHILED7DOAN
    CALL NHANTHOIGIAN
    CALL QUETLED7DOAN
    SETB KIEMTRA
    JMP HIENTHILED7DOAN
    ;################################################# ################
    ;################################################# ################
    ;################ HEN GIO ###################
    ;################################################# ################
    HENGIO1:
    MODEH1:
    MOV TAM2,DEMH1
    CALL CHUYENSANGBCD
    MOV A,53H
    MOVC A,@A+DPTR
    MOV P2,A
    CLR P0.4
    CALL T50Ms
    SETB P0.4
    MOV A,52H
    MOVC A,@A+DPTR
    MOV P2,A
    CLR P0.5
    CALL T50Ms
    SETB P0.5
    KIEMTRATANGH1:
    jb tang,kiemtragiamh1
    CALL T50Ms
    jnb tang,$
    inc demh1
    mov a,demh1
    cjne a,#24,modeh1
    mov demh1,#00
    jmp modeh1
    kiemtragiamh1:
    jb giam,kiemtramodep1
    CALL T50Ms
    jnb giam,$
    dec demh1
    mov a,demh1
    cjne a,#0ffh,modeh1
    mov demh1,#23
    jmp modeh1
    kiemtramodep1:
    jb hengio,modeh1
    CALL T50Ms
    jnb hengio,$
    modep1:
    mov tam2,demh1
    call chuyensangbcd
    mov a,53h
    movc a,@a+dptr
    mov p2,a
    CLR P0.4
    CALL T50Ms
    SETB P0.4
    mov a,52h
    movc a,@a+dptr
    mov p2,a
    CLR P0.5
    CALL T50Ms
    SETB P0.5
    ;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX
    mov tam2,demp1
    call chuyensangbcd
    mov a,53h
    movc a,@a+dptr
    mov p2,a
    CLR P0.2
    CALL T50Ms
    SETB P0.2
    mov a,52h
    movc a,@a+dptr
    mov p2,a
    CLR P0.3
    CALL T50Ms
    SETB P0.3
    kiemtratangp1:
    jb tang,kiemtragiamp1
    call t50ms
    jnb tang,$
    inc demp1
    mov a,demp1
    cjne a,#60,modep1
    mov demp1,#00
    jmp modep1
    kiemtragiamp1:
    jb giam,kiemtramodes1
    call t50ms
    jnb giam,$
    dec demp1
    mov a,demp1
    cjne a,#0ffh,modep1
    mov demp1,#59
    jmp modep1
    kiemtramodes1:
    jb hengio,modep1
    call t50ms
    jnb hengio,$
    mov tam2,demp1
    call chuyensangbcd
    mov r1,#52h
    mov r0,#53h
    xchd a,@r1
    swap a
    xchd a,@r0
    mov dulieu,a
    mov diachi,#0ah
    call truyen
    mov tam2,demh1
    call chuyensangbcd
    mov r1,#52h
    mov r0,#53h
    xchd a,@r1
    swap a
    xchd a,@r0
    mov dulieu,a
    mov diachi,#0bh
    call truyen
    setb tt
    jmp hienthiled7doan
    ;################################################# ################
    ;################################################# ################
    ;############# Chinh thoi gian ##############################
    ;################################################# ################
    chinhthoigian:
    mov 28h,#00
    mov diachi,#00h
    call nhan
    mov tam2,dulieu
    call chuyenbcdsanghex
    mov dems,tam2
    mov diachi,#01h
    call nhan
    mov tam2,dulieu
    call chuyenbcdsanghex
    mov demp,tam2
    mov diachi,#02h
    call nhan
    mov tam2,dulieu
    call chuyenbcdsanghex
    mov demh,tam2
    mov diachi,#04h
    call nhan
    mov tam2,dulieu
    call chuyenbcdsanghex
    mov demn,tam2
    mov diachi,#05h
    call nhan
    mov tam2,dulieu
    call chuyenbcdsanghex
    mov demt,tam2
    mov diachi,#06h
    call nhan
    mov tam2,dulieu
    call chuyenbcdsanghex
    mov demnd,tam2
    mov dem,#020
    modeh:
    call quetled7doanchoptat
    dec dem
    mov a,dem
    cjne a,#00,kiemtratangh
    mov dem,#020
    cpl gio
    kiemtratangh:
    jb tang,kiemtragiamh
    call t50ms
    jnb tang,$
    inc demh
    mov a,demh
    cjne a,#24,modeh
    mov demh,#00
    jmp modeh
    kiemtragiamh:
    jb giam,kiemtramodep
    call t50ms
    jnb giam,$
    dec demh
    mov a,demh
    cjne a,#0ffh,modeh
    mov demh,#23
    jmp modeh
    kiemtramodep:
    jb mode,modeh
    call t50ms
    jnb mode,$
    mov 28h,#00
    modep:
    call quetled7doanchoptat
    dec dem
    mov a,dem
    cjne a,#00,kiemtratangp
    mov dem,#020
    cpl phut
    kiemtratangp:
    jb tang,kiemtragiamp
    call t50ms
    jnb tang,$
    inc demp
    mov a,demp
    cjne a,#60,modep
    mov demp,#00
    jmp modep
    kiemtragiamp:
    jb giam,kiemtramodes
    call t50ms
    jnb giam,$
    dec demp
    mov a,demp
    cjne a,#0ffh,modep
    mov demp,#59
    jmp modep
    kiemtramodes:
    jb mode,modep
    call t50ms
    jnb mode,$
    mov 28h,#00
    modes:
    call quetled7doanchoptat
    dec dem
    mov a,dem
    cjne a,#00,kiemtratangs
    mov dem,#020
    cpl giay
    kiemtratangs:
    jb tang,kiemtragiams
    call t50ms
    jnb tang,$
    inc dems
    mov a,dems
    cjne a,#60,modes
    mov dems,#00
    jmp modes
    kiemtragiams:
    jb giam,kiemtramoden
    call t50ms
    jnb giam,$
    dec dems
    mov a,dems
    cjne a,#0ffh,modes
    mov dems,#59
    jmp modes
    kiemtramoden:
    jb mode,modes
    call t50ms
    jnb mode,$
    mov 28h,#00
    moden:
    call quetled7doanchoptat
    dec dem
    mov a,dem
    cjne a,#00,kiemtratangn
    mov dem,#020
    cpl ngay
    kiemtratangn:
    jb tang,kiemtragiamn
    call t50ms
    jnb tang,$
    inc demn
    mov a,demn
    cjne a,#32,moden
    mov demn,#00
    jmp moden
    kiemtragiamn:
    jb giam,kiemtramodet
    call t50ms
    jnb giam,$
    dec demn
    mov a,demn
    cjne a,#0ffh,moden
    mov demn,#31
    jmp moden
    kiemtramodet:
    jb mode,moden
    call t50ms
    jnb mode,$
    mov 28h,#00
    modet:
    call quetled7doanchoptat
    dec dem
    mov a,dem
    cjne a,#00,kiemtratangt
    mov dem,#020
    cpl thang
    kiemtratangt:
    jb tang,kiemtragiamt
    call t50ms
    jnb tang,$
    inc demt
    mov a,demt
    cjne a,#13,modet
    mov demt,#01
    jmp modet
    kiemtragiamt:
    jb giam,kiemtramodenam
    call t50ms
    jnb giam,$
    dec demt
    mov a,demt
    cjne a,#0ffh,modet
    mov demt,#12
    jmp modet
    kiemtramodenam:
    jb mode,modet
    call t50ms
    jnb mode,$
    mov 28h,#00
    modenam:
    call quetled7doanchoptat
    dec dem
    mov a,dem
    cjne a,#00,kiemtratangnam
    mov dem,#020
    cpl nam
    kiemtratangnam:
    jb tang,kiemtragiamnam
    call t50ms
    jnb tang,$
    inc demnd
    mov a,demnd
    cjne a,#100,modenam
    mov demnd,#00
    jmp modenam
    kiemtragiamnam:
    jb giam,kiemtramodethoat
    call t50ms
    jnb giam,$
    dec demnd
    mov a,demnd
    cjne a,#0ffh,modenam
    mov demnd,#099
    jmp modenam
    kiemtramodethoat:
    jb mode,modenam
    call t50ms
    jnb mode,$
    call guithoigian
    jmp hienthiled7doan
    ;################################################# ################
    ;################################################# ################
    ;############# Nhan thoi gian ##############################
    ;################################################# ################
    nhanthoigian:
    mov diachi,#00h
    call nhan
    mov tam2,dulieu
    call chuyensanghex
    mov r0,53h
    mov r1,52h
    mov diachi,#01h
    call nhan
    mov tam2,dulieu
    call chuyensanghex
    mov r2,53h
    mov r3,52h
    mov diachi,#02h
    call nhan
    mov tam2,dulieu
    call chuyensanghex
    mov r4,53h
    mov r5,52h
    mov diachi,#04h
    call nhan
    mov tam2,dulieu
    call chuyensanghex
    mov dulieund,53h
    mov dulieunc,52h
    mov diachi,#05h
    call nhan
    mov tam2,dulieu
    call chuyensanghex
    mov dulieutd,53h
    mov dulieutc,52h
    mov diachi,#06h
    call nhan
    mov tam2,dulieu
    call chuyensanghex
    mov demndd,53h
    mov demndc,52h
    jnb tt,x2
    mov diachi,#0ah
    call nhan
    mov tam2,dulieu
    call chuyensanghex
    mov demp1d,53h
    mov demp1c,52h
    mov diachi,#0bh
    call nhan
    mov tam2,dulieu
    call chuyensanghex
    mov demh1d,53h
    mov demh1c,52h
    x2:
    ret
    ;################################################# ################
    ;################################################# ################
    ;############# Gui thoi gian ###############################
    ;################################################# ################
    guithoigian:
    mov tam2,dems
    call chuyensangbcd
    mov r1,#52h
    mov r0,#53h
    xchd a,@r1
    swap a
    xchd a,@r0
    mov dulieu,a
    mov diachi,#00h
    call truyen
    mov tam2,demp
    call chuyensangbcd
    mov r1,#52h
    mov r0,#53h
    xchd a,@r1
    swap a
    xchd a,@r0
    mov dulieu,a
    mov diachi,#01h
    call truyen
    mov tam2,demh
    call chuyensangbcd
    mov r1,#52h
    mov r0,#53h
    xchd a,@r1
    swap a
    xchd a,@r0
    mov dulieu,a
    mov diachi,#02h
    call truyen
    mov tam2,demn
    call chuyensangbcd
    mov r1,#52h
    mov r0,#53h
    xchd a,@r1
    swap a
    xchd a,@r0
    mov dulieu,a
    mov diachi,#04h
    call truyen
    mov tam2,demt
    call chuyensangbcd
    mov r1,#52h
    mov r0,#53h
    xchd a,@r1
    swap a
    xchd a,@r0
    mov dulieu,a
    mov diachi,#05h
    call truyen
    mov tam2,demnd
    call chuyensangbcd
    mov r1,#52h
    mov r0,#53h
    xchd a,@r1
    swap a
    xchd a,@r0
    mov dulieu,a
    mov diachi,#06h
    call truyen
    ret
    ;################################################# ################
    ;################################################# ################
    ;############# Truyen I2C ###################################
    ;################################################# ################
    ;################################################# ################
    ;################################################# ################
    ;############# Nhan du lieu #################################
    ;################################################# ################
    nhan:
    call start
    mov a,#0d0h
    call send
    setb sda
    setb scl
    jb sda,nhan
    clr scl
    mov a,diachi
    call send
    setb sda
    setb scl
    jb sda,nhan
    clr scl
    call start
    mov a,#0d1h
    call send
    setb sda
    setb scl
    jb sda,nhan
    clr scl
    call receive
    call stop
    ret
    receive:
    mov r7,#08h
    lap_receive:
    setb scl
    mov c,sda
    clr scl
    rlc a
    djnz r7,lap_receive
    mov dulieu,a
    setb scl
    clr sda
    clr scl
    ret
    ;################################################# ################
    ;################################################# ################
    ;############# Truyen du lieu ###############################
    ;################################################# ################
    truyen:
    call start
    mov a,#0d0h
    call send
    setb sda
    setb scl
    jb sda,truyen
    clr scl
    mov a,diachi
    call send
    setb sda
    setb scl
    jb sda,truyen
    clr scl
    mov a,dulieu
    call send
    setb sda
    setb scl
    jb sda,truyen
    clr scl
    call stop
    ret
    send:
    mov r7,#08h
    lap_send:
    rlc a
    mov sda,c
    setb scl
    clr scl
    djnz r7,lap_send
    ret
    ;################################################# ################
    ;################################################# ################
    ;############# Start I2C ####################################
    ;################################################# ################
    start:
    setb sda
    setb scl
    nop
    nop
    clr sda
    nop
    nop
    clr scl
    nop
    ret
    ;################################################# ################
    ;################################################# ################
    ;############# Stop I2C #####################################
    ;################################################# ################
    stop:
    clr sda
    nop
    nop
    setb scl
    nop
    nop
    setb sda
    ret
    ;################################################# ################
    ;################################################# ################
    ;############# Quet led 7 doan chop tat #####################
    ;################################################# ################
    quetled7doanchoptat:
    jb gio,phut1
    mov tam2,demh
    call chuyensangbcd
    mov a,01010011B ;53H
    movc a,@a+dptr
    mov p2,a
    CLR P0.4
    CALL T50Ms
    SETB P0.4
    mov a,52h
    movc a,@a+dptr
    mov p2,a
    CLR P0.5
    CALL T50Ms
    SETB P0.5
    phut1:
    jb phut,giay1
    mov tam2,demp
    call chuyensangbcd
    mov a,53h
    movc a,@a+dptr
    mov p2,a
    CLR P0.2
    CALL T50Ms
    SETB P0.2
    mov a,52h
    movc a,@a+dptr
    mov p2,a
    CLR P0.3
    CALL T50Ms
    SETB P0.3
    giay1:
    jb giay,ngay1
    mov tam2,dems
    call chuyensangbcd
    mov a,53h
    movc a,@a+dptr
    mov p2,a
    CLR P0.0
    CALL T50Ms
    SETB P0.0
    mov a,52h
    movc a,@a+dptr
    mov p2,a
    CLR P0.1
    CALL T50Ms
    SETB P0.1
    ngay1:
    jb ngay,thang1
    mov tam2,demn
    call chuyensangbcd
    mov a,53h
    movc a,@a+dptr
    mov p2,a
    CLR P0.7
    CALL T50Ms
    SETB P0.7
    mov a,52h
    movc a,@a+dptr
    mov p2,a
    CLR P0.6
    CALL T50Ms
    SETB P0.6
    thang1:
    jb thang,nam1
    mov tam2,demt
    call chuyensangbcd
    mov a,53h
    movc a,@a+dptr
    mov p2,a
    CLR P1.3
    CALL T50Ms
    SETB P1.3
    mov a,52h
    movc a,@a+dptr
    mov p2,a
    CLR P1.2
    CALL T50Ms
    SETB P1.2
    nam1:
    jb nam,thoatquet
    mov tam2,demnd
    call chuyensangbcd
    mov a,53h
    movc a,@a+dptr
    mov p2,a
    CLR P1.7
    CALL T50Ms
    SETB P1.7
    mov a,52h
    movc a,@a+dptr
    mov p2,a
    CLR P1.6
    CALL T50Ms
    SETB P1.6
    mov a,#00h
    movc a,@a+dptr
    mov p2,a
    CLR P1.5
    CALL T50Ms
    SETB P1.5
    mov a,#02h
    movc a,@a+dptr
    mov p2,a
    CLR P1.4
    CALL T50Ms
    SETB P1.4
    ret
    thoatquet:
    ret
    ;################################################# ################
    ;################################################# ################
    ;############# Quet led 7 doan ##############################
    ;################################################# ################
    quetled7doan:
    mov a,r0
    movc a,@a+dptr
    mov p2,a
    CLR P0.0
    CALL T50Ms
    SETB P0.0
    mov a,r1
    movc a,@a+dptr
    mov p2,a
    CLR P0.1
    CALL T50Ms
    SETB P0.1
    mov a,r2
    movc a,@a+dptr
    mov p2,a
    CLR P0.2
    CALL T50Ms
    SETB P0.2
    mov a,r3
    movc a,@a+dptr
    mov p2,a
    CLR P0.3
    CALL T50Ms
    SETB P0.3
    mov a,r4
    movc a,@a+dptr
    mov p2,a
    CLR P0.4
    CALL T50Ms
    SETB P0.4
    mov a,r5
    movc a,@a+dptr
    mov p2,a
    CLR P0.5
    CALL T50Ms
    SETB P0.5
    mov a,dulieund
    movc a,@a+dptr
    mov p2,a
    CLR P0.7
    CALL T50Ms
    SETB P0.7
    mov a,dulieunc
    movc a,@a+dptr
    mov p2,a
    CLR P0.6
    CALL T50Ms
    SETB P0.6
    mov a,dulieutd
    movc a,@a+dptr
    mov p2,a
    CLR P1.3
    CALL T50Ms
    SETB P1.3
    mov a,dulieutc
    movc a,@a+dptr
    mov p2,a
    CLR P1.2
    CALL T50Ms
    SETB P1.2
    mov a,demndd
    movc a,@a+dptr
    mov p2,a
    CLR P1.7
    CALL T50Ms
    SETB P1.7
    mov a,demndc
    movc a,@a+dptr
    mov p2,a
    CLR P1.6
    CALL T50Ms
    SETB P1.6
    mov a,#00h
    movc a,@a+dptr
    mov p2,a
    CLR P1.5
    CALL T50Ms
    SETB P1.5
    mov a,#02h
    movc a,@a+dptr
    mov p2,a
    CLR P1.4
    CALL T50Ms
    SETB P1.4
    ret
    ;################################################# ###################
    ;################################################# ###################
    ;############################# Thoi gian quet led #######################
    ;################################################# ###################
    t50ms:
    push 30h
    push 31h
    mov 30h,#4
    mov 31h,#1
    lap:
    djnz 31h,$
    djnz 30h,lap
    pop 31h
    pop 30h
    ret
    ;################################################# ###################
    ;################################################# ###################
    ;########################## Chuyen BCD sang HEX ##########################
    ;################################################# ###################
    chuyenbcdsanghex:
    mov a,tam2
    anl a,#00001111b
    mov 53h,a
    mov a,tam2
    anl a,#11110000b
    swap a
    mov 52h,a
    mov b,52h
    mov a,#0ah
    mul ab
    add a,53h
    mov tam2,a
    ret
    ;################################################# ###################
    ;################################################# ###################
    ;########################## Chuyen sang HEX ##########################
    ;################################################# ###################
    chuyensanghex:
    mov a,tam2
    anl a,#00001111b
    mov 53h,a
    mov a,tam2
    anl a,#11110000b
    swap a
    mov 52h,a
    ret
    ;################################################# ##############
    ;################################################# ##############
    ;########################## Chuyen sang BCD ########################
    ;################################################# ##############
    chuyensangbcd:
    tam equ 51h
    tam1 equ 50h
    mov tam,tam2
    mov a,tam
    mov b,#10
    div ab
    mov 52h,a
    mov b,#10
    mul ab
    mov tam1,a
    mov a,tam
    clr c
    subb a,tam1
    mov 53h,a
    ret
    ;################################################# #################
    ;################################################# #################
    ;###################### Du lieu quet led 7 doan ############################
    ;################################################# #################
    LED7ANODE:
    DB 03FH,006H,05BH,04FH,066H,06DH,07DH,007H,07FH,06FH ;MUC 1
    ;################################################# #################
    end


    Sao mình up file mo phỏng lên không được
    Click image for larger version

Name:	giup.jpg
Views:	1
Size:	56.9 KB
ID:	1413376
    Last edited by minhthanh29; 25-06-2012, 01:58.
    Nhận vẽ mạch in ^_^
    TEL: 0167 4500 365
    Mail:

  • #2
    Ôi trời ơi! Nhìn cái code này của bạn mình cũng suýt ngất. Mình không biết viết code giúp bạn thế nào nhưng mình có 1 góp ý nhỏ thế này:
    Bạn nên đưa lên cái sơ đồ mạch phần cứng, để mọi người biết bạn kết nối thế nào còn giúp chứ.

    Comment


    • #3
      Nguyên văn bởi Ck33spkt Xem bài viết
      Ôi trời ơi! Nhìn cái code này của bạn mình cũng suýt ngất. Mình không biết viết code giúp bạn thế nào nhưng mình có 1 góp ý nhỏ thế này:
      Bạn nên đưa lên cái sơ đồ mạch phần cứng, để mọi người biết bạn kết nối thế nào còn giúp chứ.
      Mình up file mo phỏng lên không được, chỉ up được hình à.



      Đoạn code trên chậy tốt nhưng không hiểu sao chân số 7 của ds1307 không có xung ra
      Nhận vẽ mạch in ^_^
      TEL: 0167 4500 365
      Mail:

      Comment


      • #4
        Sao không ai vào giúp mình hêt vậy
        Nhận vẽ mạch in ^_^
        TEL: 0167 4500 365
        Mail:

        Comment


        • #5
          Nguyên văn bởi minhthanh29 Xem bài viết
          Sao không ai vào giúp mình hêt vậy
          MAIN:

          CLR P3.7
          MOV P0,#0FFH
          MOV DPTR,#LED7ANODE
          MOV DEMS,#00
          MOV DEMP,#00
          MOV DEMH,#00
          MOV DEMND,#11
          MOV DEMN,#00
          MOV DEMT,#00
          MOV DEMH1,#00
          MOV DEMP1,#00
          ;thêm đoạn này:
          mov dulieu,#10h
          mov diachi,#07h
          call truyen

          ;################################################# ################
          ;##################### HIEN THI LED 7 DOAN #####################
          ;################################################# ################
          |

          Comment


          • #6
            Nguyên văn bởi tdm Xem bài viết
            MAIN:

            CLR P3.7
            MOV P0,#0FFH
            MOV DPTR,#LED7ANODE
            MOV DEMS,#00
            MOV DEMP,#00
            MOV DEMH,#00
            MOV DEMND,#11
            MOV DEMN,#00
            MOV DEMT,#00
            MOV DEMH1,#00
            MOV DEMP1,#00
            ;thêm đoạn này:
            mov dulieu,#10h
            mov diachi,#07h
            call truyen

            ;################################################# ################
            ;##################### HIEN THI LED 7 DOAN #####################
            ;################################################# ################
            Thanks bạn nhiều mình làm được rồi, bạn cho mình xin nick yahoo được không có gì học hỏi lẫn nhau
            Nhận vẽ mạch in ^_^
            TEL: 0167 4500 365
            Mail:

            Comment


            • #7
              Nó chạy nhưng không đúng 1 Hz
              Nhận vẽ mạch in ^_^
              TEL: 0167 4500 365
              Mail:

              Comment


              • #8
                Các bạn ơi vào giúp mình đi, mình sửa nhưng vẫn không đúng 1 hz
                Nhận vẽ mạch in ^_^
                TEL: 0167 4500 365
                Mail:

                Comment


                • #9
                  ko đúng 1Hz có thể nào do bị ảnh hưởng tốc độ mô phỏng của máy tính ko ? mình thấy chạy tốt mà ! có đều phần Hẹn giờ ko khả thi, loa ko kêu nổi & kêu trong bao lâu thì tắt loa ? mà bạn đã ráp thực tế chưa vậy ?

                  Comment


                  • #10
                    Nguyên văn bởi crazyled Xem bài viết
                    ko đúng 1Hz có thể nào do bị ảnh hưởng tốc độ mô phỏng của máy tính ko ? mình thấy chạy tốt mà ! có đều phần Hẹn giờ ko khả thi, loa ko kêu nổi & kêu trong bao lâu thì tắt loa ? mà bạn đã ráp thực tế chưa vậy ?
                    Mình đã lắp board thật rồi dùng tốt, phần hẹn giờ vẫn ổn thêm ic nhạc hay máy cái còi TQ nó kêu khi nào mình nhấn nút mode thì hết kêu, chỉ có tội chân số 7 của ds1307 không ra đúng 1Hz.
                    Nhận vẽ mạch in ^_^
                    TEL: 0167 4500 365
                    Mail:

                    Comment


                    • #11
                      Các bạn đau rồi vào giúp mình đi đang cần gấp, thanks
                      Nhận vẽ mạch in ^_^
                      TEL: 0167 4500 365
                      Mail:

                      Comment


                      • #12
                        giúp mình sửa đoạn code đi mấy bạn
                        Nhận vẽ mạch in ^_^
                        TEL: 0167 4500 365
                        Mail:

                        Comment


                        • #13
                          Nguyên văn bởi minhthanh29 Xem bài viết
                          giúp mình sửa đoạn code đi mấy bạn
                          làm thế nào bạn biết nó không đúng 1hz.
                          |

                          Comment


                          • #14
                            Nguyên văn bởi minhthanh29 Xem bài viết
                            giúp mình sửa đoạn code đi mấy bạn
                            nếu bạn nối led vào thử thì led sẽ sáng 500ms và tắt 500ms.
                            |

                            Comment


                            • #15
                              Nguyên văn bởi tdm Xem bài viết
                              làm thế nào bạn biết nó không đúng 1hz.
                              Thì mình thấy chu kỳ sáng tắt đâu có đủ 1s
                              Nhận vẽ mạch in ^_^
                              TEL: 0167 4500 365
                              Mail:

                              Comment

                              Về tác giả

                              Collapse

                              minhthanh29 Tìm hiểu thêm về minhthanh29

                              Bài viết mới nhất

                              Collapse

                              Đang tải...
                              X