8051音樂盒

我需要8051音樂盒ㄉ套裝電路...

請問哪裡有在賣<要訣對位置...>

如有完成品...

是否能割愛便宜賣我...

估價<300~500>

Update:

p.s是用89c51IC作ㄉ專題...

1 Answer

Rating
  • BUMEGG
    Lv 7
    2 decades ago
    Favorite Answer

    SO= 392hz 2551 uS LA= 440hz 2273uS SI = 494HZ 2024uS HDO= 523HZ 1912 uS HRE= 587HZ 1704uS HMI 656HZ 1517us HFA = 689HZ 1433uS HSO = 784HZ 1276 uS; 如要發SO的音其頻率為392HZ 也就是 ON = 2551uS /2 off = 2552uS /2

    利用p3.7為輸出port

    so equ 0

    la equ 1

    si equ 2

    hdo equ 3

    hre equ 4

    hmi equ 5

    hfa equ 6

    hso equ 7

    org 00h

    start: mov r3,#nnn

    mov r4,#0h

    loop: call song

    mov r5,a

    inc r4

    call song

    mov r2,a

    call play

    inc r4

    djnz r3,loop

    jmp start

    play:

    mov a,r5

    rl a

    push acc

    mov dptr,#frqtab

    mov a,@a+dptr

    mov r0,a

    inc dptr

    pop acc

    movc a,@a+dptr

    mov r1,a

    call tone

    ret

    tone:

    loop3: mov r6,1

    loop2: cpl p3.7

    mov r7,0

    loop1: jmp $+2

    nop

    djnz r7,loop1

    djnz r6,loop2

    djnz r2,loop3

    setb p3.7

    ret

    frqtab: db 255,98

    db 227,110

    db 202,124

    db 191,131

    db 170,147

    db 151,165

    db 143,175

    db 127,196

    song: mov a,r4

    inc a

    movc a,@a+pc

    ret

    melody: db so,3...................;這理放譜,幾拍

    nnn equ ($-melody)/2

    end

    2006-02-17 20:31:35 補充:

    是8051單晶片的組合語言,去參考一下儒林sim2461,8051單晶片微電腦原理與實作

    Source(s): 自己搞一個吧
Still have questions? Get your answers by asking now.