Y
yoyoteng
Guest
--We are trying to let ISD4002 work with 8051
--below is our source code-------------------
SS .reg p2.0
MOSI .reg P2.1
MISO .reg P2.2
SCLK .reg P2.4
PUSH .reg P2.5
org 0
mov p0,#00000000b
jmp Start
Start: mov sp,#6fh ;
;---------------test------------------------------------
mov r3,#7 ; runs a shift of light at startup
mov a,#11111110b ;
Left: mov p1,a ;
call delay ;
rl a ;
djnz r3,Left
;---------test-end-----------------------------------------
;--------main-----------
mov a,#00000000b
mov p2,a
setb PUSH
PUSH_1:
jb PUSH,PUSH_1
clr SS ; SS low
power:
mov a,#00000000b ; powers up the ISD4002
call Go
mov a,#00000100b
call Go
REC:
mov a,#00000000b ; set the ISD4002 to record
call Go
mov a,#00000101b
call Go
PLAY: ;
mov a,#00000000b
call Go
mov a,#00001111b
call Go
jmp Start
;--------main-end-----
;-------------set-mosi-----------
Go: mov r5,#8
GO_1: rlc a
mov MOSI,C
call clk
djnz r5,GO_1
ret
;-------------set-mosi-end-------------
;--------clk------------
clk:
call cpush ;-----------判斷是否繼續按
setb SCLK
call delay
cpl SCLK
call delay
ret
;--------delay-----0.001sec-1KHz--------
delay:
mov r7,#1
djnz r7,delay
ret
;--------delay-end----------------------------------
;--------check-push--------------
cpush:
jb PUSH,STOP
ret
;--------check-push-end----------------------
;-------stop----------------
STOP:
mov a,#00000000b
call Go_2
mov a,#00001100b
call Go_2
jmp PLAY
;****jmp Start
Go_2: mov r5,#8
GO_3: rlc a
mov MOSI,C
call clk_1
djnz r5,GO_3
ret
clk_1:
setb SCLK
call delay
cpl SCLK
call delay
ret
;-----------------------------------------
end
;----we do not know where it went wrong, the
;---SCLK could not be picked up by a LOGIC PROBE, nor oscillator.
;---any suggestion?
thanks for finishing browsing my question.
(ISD4002datasheet link www.winbond-usa.com/products/isd_products/
chipcorder/datasheets/I4002Rev1.pdf )
--below is our source code-------------------
SS .reg p2.0
MOSI .reg P2.1
MISO .reg P2.2
SCLK .reg P2.4
PUSH .reg P2.5
org 0
mov p0,#00000000b
jmp Start
Start: mov sp,#6fh ;
;---------------test------------------------------------
mov r3,#7 ; runs a shift of light at startup
mov a,#11111110b ;
Left: mov p1,a ;
call delay ;
rl a ;
djnz r3,Left
;---------test-end-----------------------------------------
;--------main-----------
mov a,#00000000b
mov p2,a
setb PUSH
PUSH_1:
jb PUSH,PUSH_1
clr SS ; SS low
power:
mov a,#00000000b ; powers up the ISD4002
call Go
mov a,#00000100b
call Go
REC:
mov a,#00000000b ; set the ISD4002 to record
call Go
mov a,#00000101b
call Go
PLAY: ;
mov a,#00000000b
call Go
mov a,#00001111b
call Go
jmp Start
;--------main-end-----
;-------------set-mosi-----------
Go: mov r5,#8
GO_1: rlc a
mov MOSI,C
call clk
djnz r5,GO_1
ret
;-------------set-mosi-end-------------
;--------clk------------
clk:
call cpush ;-----------判斷是否繼續按
setb SCLK
call delay
cpl SCLK
call delay
ret
;--------delay-----0.001sec-1KHz--------
delay:
mov r7,#1
djnz r7,delay
ret
;--------delay-end----------------------------------
;--------check-push--------------
cpush:
jb PUSH,STOP
ret
;--------check-push-end----------------------
;-------stop----------------
STOP:
mov a,#00000000b
call Go_2
mov a,#00001100b
call Go_2
jmp PLAY
;****jmp Start
Go_2: mov r5,#8
GO_3: rlc a
mov MOSI,C
call clk_1
djnz r5,GO_3
ret
clk_1:
setb SCLK
call delay
cpl SCLK
call delay
ret
;-----------------------------------------
end
;----we do not know where it went wrong, the
;---SCLK could not be picked up by a LOGIC PROBE, nor oscillator.
;---any suggestion?
thanks for finishing browsing my question.
(ISD4002datasheet link www.winbond-usa.com/products/isd_products/
chipcorder/datasheets/I4002Rev1.pdf )