Let me know Don. Perhaps we can share some code.
peterdeco1, Here is a subroutine I wrote quite a few years back for a repeater. The plyrec flag is for playback/record. It uses the chip select, interrupt, eom, mosi and clock. It was for recording and playing back 6, 20 second messages from a 120 second part. I hope it helps....
Dave Purola,
N8NTA
'************************************************* ********************
ISDDVR1:' SPI DRIVER FOR ISD-33120 DVR
'************************************************* ********************
ISDSEL = 0 'SET <>CE LOW
SHIFTOUT MOSI,SCLK,0,[%00100\5] 'SEND POWER-UP COMMAND
ISDSEL = 1 'SET <>CE HIGH
PAUSTIME = 30 'WAIT FOR POWER-UP SEQUENCE TO COMPLETE
GOSUB WAITIME
IF PLYREC=0 THEN REC 'CHECK FOR RECORD MODE
PLY:
ISDSEL = 0 'SET <>CE LOW
SHIFTOUT MOSI,SCLK,0,[((DRCHANL MIN 5)*133)\11,%11100\5] 'START PLAYBACK @ ADDRESS
ISDSEL = 1 'SET <>CE HIGH
PAUSE 1
ISDSEL = 0 'SET <>CE LOW
SHIFTOUT MOSI,SCLK,0,[%11110\5] 'CONTINUE PLAYBACK @ ADDRESS
ISDSEL = 1 'SET <>CE HIGH
TIMSTAMP = 0
WHILE TIMSTAMP<20000 'WAIT FOR 20 SEC or UNTIL EOM
IF EOM_OVF=0 THEN CLRDR 'CHECK FOR EOM, IF NOT BUSY THEN FINISHED
WEND
GOTO CLRDR 'NO EOM BIT TO BE FOUND IN TIME
REC:
TIMSTAMP = 0
WHILE TIMSTAMP<3000 'START TIMING LOOP FOR UNKEY (~3 SEC)
IF COR=1 THEN CONTREC 'WAIT FOR COR/COS TO DROP
WEND
GOTO CLRDR 'NO UNKEY TO BE FOUND IN TIME
CONTREC:
TIMSTAMP = 0
WHILE TIMSTAMP<3000 'START TIMING LOOP FOR UNKEY (~3 SEC)
IF COR=0 THEN SREC 'CHECK FOR COR/COS PRESENT
WEND
GOTO CLRDR 'TIME IS UP SO, FINISH OPERATION
SREC:
ISDSEL = 0 'SET <>CE LOW
SHIFTOUT MOSI,SCLK,0,[((DRCHANL MIN 5)*133)\11,%10100\5] 'START RECORD @ ADDRESS
ISDSEL = 1 'SET <>CE HIGH
PAUSE 1
ISDSEL = 0 'SET <>CE LOW
SHIFTOUT MOSI,SCLK,0,[%10110\5] 'CONTINUE RECORD @ ADDRESS
ISDSEL = 1 'SET <>CE HIGH
TIMSTAMP = 0
WHILE TIMSTAMP<19900 'WAIT FOR 19.9 SEC or UNTIL EOM
IF EOM_OVF=0 OR COR=1 THEN CLRDR 'IF COR/COS DROPPED OR EOM THEN STOP RECORD
WEND
CLRDR:
ISDSEL = 0 'SET <>CE LOW
SHIFTOUT MOSI,SCLK,0,[%00000\5] 'STOP REC/PLY @ POWER DOWN
ISDSEL = 1 'SET <>CE HIGH
RETURN
Well Dave,
I think you've saved me a ton of trial and error! Thanks!
- Don
Thanks Dave. Your code is almost identical to the 5008 code except there are 3 SHIFTOUTs to get the 5008 to go from record to play. Once in play, the first 2 config bits are stored in a temporary register so you can just repeat the 3rd to do things like message cueing.
/*Hello everyone, health and harmony from Brazil. For the subrotina, just put it in my code or have to declare it before?
It can be used with the PIC16F877 and ISD2590? I have one and I thought he would never use it ...
I am building a small robot and would like to respond to the same external events through sounds or phrases.
Thanks to all.*/
Well, I have an ISD17120 working under SPI control. I still have some things to figure out for the recording operation, but I'm pretty pleased, so far.
I decided to use a Basic Atom for the prototype to make it a little easier on me. The code is almost the same - if not identical.
Dave, your post was a big help to get the SPI sorted out, but otherwise, the ISD17120 is a whole different animal than those other ISD devices.
One big, dumb mistake that I couldn't figure out until I got out the oscilliscope - I had used back slashes instead of forward slashes in the SHIFTOUT syntax! So, it was always shifting out 16 bits and the command codes were divided by the number of bits I had intended to send!
I'll post some code when I get the recording down. Meanwhile, if anyone else is having problems with an ISD1700 device, I may be able to help.
- Don
Hey Don...
I am working with the ISD1740 under SPI control- any example code for operating with the set_play command would be greatly appreciated! All I want to do in my application is set the play pointer to the beginning of a given message address and play the message. I need to be able to set the address beginning and end to play pre-recorded "sound effects" from the chip.
Bookmarks