關于 ISD4002 語音錄放的原程序,前段時間搞了好久,結果是自己搞的太亂了,現在這個程序是調試好的,現在已經在做了,不過是51的,大家改下就可以用在 PIC 上了,因為我沒有檫寫芯片,市場也沒找到,就買了個 89C2051試 了.
;4002-120 錄音程序 (不分段一次性錄完直到 OVF標志----指示ISD的錄、放操作已到達存儲器的未尾。結束) ; this is a basic recore and play programe if you want add other control plaease do it yourself. by LINPO Andy Tks ! SS EQU P1.0 SCLK EQU P1.1 MOSI EQU P1.2 LED EQU P1.7 AN EQU P1.6 STOP EQU P1.5 PR EQU P1.4 ADDRESSL EQU 30H CANDAH EQU 31H RECORC EQU 32H SIG EQU 33H PANDAH EQU 34H PLAYC EQU 35H
ORG 0000H AJMP START ORG 0030H START: MOV P1,#0FFH MOV P3,#0FFH MAIN: SETB LED KEY: JB AN,KEY LCALL DELAY_20ms JB AN,KEY JNB PR,PLAY AJMP RECORD ;///////////////////////////// RECORDING /////////////// RECORD: ACALL POWERUP ACALL DELAY_30ms ACALL POWERUP ACALL DELAY_30ms ACALL DELAY_30ms CLR SS MOV ADDRESSL,#50H MOV CANDAH,#0A0H MOV A,ADDRESSL ACALL SEND MOV A,CANDAH ACALL SEND SETB SS CLR SS MOV RECORC,#0B0H MOV A,RECORC ACALL SEND CLR LED SETB SS KEY1: JNB P3.2,STOPRE JB AN,KEY1 LCALL DELAY_20ms JB AN,KEY1 STOPRE: SETB LED CLR SS MOV A,#10H ACALL SEND SETB SS AJMP MAIN ;////////////////////////////////////// PLAY AUDIO //////////////////////////// PLAY: ACALL POWERUP ACALL DELAY_30ms CLR SS MOV ADDRESSL,#70H MOV PANDAH,#0E0H MOV A,ADDRESSL ACALL SEND MOV A,PANDAH ACALL SEND SETB SS CLR SS MOV PLAYC,#0F0H MOV A,PLAYC ACALL SEND SETB SS CLR LED
KEY2: JNB P3.2,STOPRE JB STOP,KEY2 ACALL DELAY_20ms JB STOP,KEY2 AJMP STOPRE
POWERUP: MOV A,#20H CLR SS ACALL SEND SETB SS RET ;/////////////////////// TRANSLATION DATA ///////////////////////// SEND: CLR SCLK CLR MOSI MOV R1,#08H OUT: CLR SCLK ;時鐘下降 RRC A MOV MOSI,C ;輸出1位 NOP NOP NOP SETB SCLK NOP NOP NOP DJNZ R1,OUT RET
DELAY_30ms: MOV R1,#40H DL: MOV R2,#0FFH DJNZ R2,$ DJNZ R1,DL RET DELAY_20MS: MOV R1,#30H DL1: MOV R2,#0FFH DJNZ R2,$ DJNZ R1,DL1 RET END