Winbond ISD1700 Voice Recorder - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 41 to 59 of 59
  1. #41
    Join Date
    Sep 2005
    Location
    Dayton, Ohio
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    Yes, bit-banged.

    The ISD1700 chips are tempermental to say the least. I have it working fine in my project, but there are some undocumented problems with this chip. Overall the documentation is inconsistent/poor and difficult to find current versions. I found out after a year of using this chip that I had the outdated datasheets.

    Also, the development systems were redesigned when it moved from Winbond to Nuvoton. And the Winbond hardware does not work with Nuvoton software, so if you were unlucky to buy the early ones, you get to buy it all over again (or you just design your own). I like this chip, but Nuvoton does not help with the problems.

    As for SPI, I have worked with the ISD1700 and another SPI device connected to the same PIC micro. Each device uses the complete opposite SPI communications format. The logic levels are inverted and the MSB/LSB is reversed on each device. I don't know which way is "standard" for SPI. So you may want to try changing MSB/LSB data and try inverting various signals (clock, data, chip select).

    Otherwise the code examples in previous posts on this thread should be a good head start.
    Jim Robertson
    "MilesTag" DIY Lasertag
    www.lasertagparts.com/mtdesign.htm
    Dayton, Ohio

  2. #42
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Exclamation

    Quote Originally Posted by milestag View Post
    The ISD1700 chips are tempermental to say the least. I have it working fine in my project, but there are some undocumented problems with this chip. Overall the documentation is inconsistent/poor and difficult to find current versions. I found out after a year of using this chip that I had the outdated datasheets.
    They are indeed temperamental. The timing information in the data sheets may be off by as much as 25%, and this is different from one device model to the next.

    I've been working with one for the past 2 weeks . . .
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  3. #43
    Join Date
    Mar 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Latest Data Sheet Version?

    Hello All,

    I've made some progress. At least the MISO pin is "singing" with 1's and 0's. But I can't seem to get the chip to record or play. I'm using the LED off of pin 2 as an indicator. I even put a test probe and monitored the pin 2 just in case the LED was put in backwards.

    I also started monitoring pins for more "foolproof" software rather than guessing at delays. One of the things I realized that after sending the record command, 0x51 (bit 4 set for LED) and 0x00 (data byte), the interrupt bit in SR0 never gets set. And according to the datasheet I believe it's suppose to get set after executing that command. I also tried sending the stop command right after the record command, thinking that maybe the interrupt bit is set after the record command is stopped, and this still doesn't result in the interrupt bit being set.

    I just want to make sure I'm using the latest datasheet. Is revision 1.1 from May 2007 the latest?

    Thanks, Alan

  4. #44
    Join Date
    Nov 2006
    Location
    Murrieta, CA
    Posts
    62


    Did you find this post helpful? Yes | No

    Default Did you get a compiler?

    Hey ams,
    you stated in a previous post something about using C programming. are you even using Picbasic Pro for your pic project or you trying to do this in C?

    what is the size of your ISD device you stated its a 1700 but no size specified. this is important as you need to know the start and end addresses of the messages you are trying to record.

    If you haven't seen my post #30 i definitely recommend the Cowlacious Designs ISD board. http://www.cowlacious.com/AudioProd.htm

    -RFEFX
    There are 10 kinds of people. Those that know binary and those that do not.

  5. #45
    Join Date
    Nov 2006
    Location
    Murrieta, CA
    Posts
    62


    Did you find this post helpful? Yes | No

    Default

    On my very first post i linked the Design guide.

    the design guide is different from the datasheet as it gives you vital ISP codes and timing information.

    Make sure you are referring to the design guide and not the data sheet.

    Unless Nuvaton changed this....

    but then again, my project is working... (no offense)

    if you are using Picbasic you mind posting some of your code so that some of us may analyze it? I'm sure Jerson can dissect it in his sleep (again no offense)
    There are 10 kinds of people. Those that know binary and those that do not.

  6. #46
    Join Date
    Mar 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    RFEFX,

    Yes I'm using C to program. I figured this post was as much about interfacing with the ISD17000 and using that hardware, that it was okay to post my question(s) as long as I leave the actual programming out of it. If it's not, just let me know.

    Yes, I've been using your Post 30 as a guide for the SPI interface. Thanks for your work. It's been a great start and will definitely help.

    I'm working with a custom PCB I built. I'm still on rev 1, so we'll see how good of a PCB designer I am

    I'm also using the 17240 chip. I'm only using the generic record and play commands at this point. Would their be a reason I can't do this?

    Alan
    Last edited by ams0178; - 17th March 2010 at 08:04. Reason: Didn't answer all previous questions.

  7. #47
    Join Date
    Mar 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Updated Design Guide

    RFEFX,

    I'm actually using a later version of the design guide. If you or anyone for that matter wants a later version, send me a PM with your email and I can email you the PDF.

    Alan

  8. #48
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,796


    Did you find this post helpful? Yes | No

    Default

    I have version 1.31, Nov. 6, 2008.

    Ioannis

  9. #49
    Join Date
    Mar 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default Getting Close But Not Quite There

    Hey Guys,

    I'm getting close but I'm not quite there. I have the audio chip recording and playing because the LED is constant during recording and blinks during playing. But unfortunately I'm not getting anything out of the speaker except a small hum. I've documented my setup of what I'm doing below. I'm a little bit unfamiliar with audio signals so its certainly possible that I might be doing something wrong.

    I'm using the audio in pin which has a 0.1uF cap on it as recommended in the datasheet. Once powered up in SPI mode, the ISD17000 should assumes that the audio input is from this pin and not the microphone, (If I read the design guide correctly). I'm trying to put a simple audio output signal from my PC tower into this pin. I cut off the end of a wire that has an audio jack on the one end. There was a red wire and a white wire inside that I stripped down to the wire. I tested the output audio signals with an oscilloscope and they're between +/- 1 Volt. I didn't think it mattered which wire I soldered to the audio input pin on my board because as far as I know audio is just a differential signal, right? But currently the white wire is soldered to the input pin. And I tied the red wire to ground. I even monitored the input signals here as I recorded them and saw the input on the oscilloscope. But when I go to play back the recording, the speaker just hums as if there was only a very faint sound.

    Does anybody know what I'm doing wrong? Any suggestions for troubleshooting? I'm not sure what to check next.

    Thanks, Alan

  10. #50
    Join Date
    Mar 2009
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    Well I actually figured out 2 things. 1) The analog input is not a factory default. Bit 6 of the APC register should be cleared to use the analog input. 2) If you enable the visual LED aid during recording or playing and do a read status command without the LED bit enabled, the LED will stop even if it continues to read or write. Learned that lesson in about 5 hours earlier today.

    Alan

  11. #51
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,796


    Did you find this post helpful? Yes | No

    Default

    Have a look at this:

    http://www.4dsystems.com.au/prod.php?id=73

    Almost unlimited messages!

    Ioannis

  12. #52
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis View Post
    I have version 1.31, Nov. 6, 2008.
    Mine is Rev. 0, October 2006.
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  13. #53
    Join Date
    Nov 2006
    Location
    Murrieta, CA
    Posts
    62


    Did you find this post helpful? Yes | No

    Default 4dsystems

    Yeah Ioannis,
    i saw that audio module a while back .. i will be ordering one soon and posting my project here... i do have several Oled displays from them as well... they make very well designed products and i do recommend them.

    - RFEFX
    There are 10 kinds of people. Those that know binary and those that do not.

  14. #54
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,796


    Did you find this post helpful? Yes | No

    Default

    I will be looking forward in reading your review of the product.

    Please do post your results on this.

    Ioannis

  15. #55
    derbende's Avatar
    derbende Guest


    Did you find this post helpful? Yes | No

    Default Re: Winbond ISD1700 Voice Recorder

    thank you very much for the nice code.

    I have tested your code and it is working proerly. I can play and erase the voices by using ISD_ERASE and ISD_PLAY function. However I couldn't record any voices. I am very glad if you can help me. I can nor record any voices in defined addresses. how can I do it?



    Quote Originally Posted by milestag View Post
    This works so far to play back 4 sounds repeatedly. The volume setting via apc2 works also. Next I plan to get rid of the PAUSE delays and monitor status to determine when each sound finished playing.

    Code:
    'DEMO PLAYER FOR ISD1700
    'Code Version: 01 
    'Words Used = 354
    'Revision Date: 8 Feb 2009
    'PicBasic Pro Compiler version 2.50b
    'Processor=PIC16F684  (WDT=ON, MCLR=INPUT, OSC=INTOSC)
    
    'Modified from code posted by Jerson and Brenon
    
    'Memory Reference:
    'ISD17XX First Address = 0x010
    'ISD1730 Max Address   = 0x0FF
    'ISD1760 Max Address   = 0x1EF
    'ISD1790 Max Address   = 0x2DF
    
    	DEFINE OSC 8
    '*************************************************************
    '*************************************************************
    '******************** DEFINE VARIABLES ***********************
    '*************************************************************
    '*************************************************************
    temp_bit    VAR BIT
    
    temp		VAR BYTE
    spi_cnt 	             var byte	' counter for SPI transfer
    bSPI 		var byte 	' the byte being transferred on SPI
    
    s_addr		VAR WORD	' Start Address
    e_addr		VAR WORD	' End Address
    
    ISD_Data 	var byte[7]	' This array contains data to/from ISD
    
    SR0a 		var ISD_Data[0]
    SR0b 		var ISD_Data[1]
    SR1 		var ISD_Data[2]    ' only valid after ReadStatus
    
    isCmdErr 	var SR0a.0	             ' 1=previous command failed/ignored
    isFull 		var SR0a.1	' 1=memory full
    isPU		var SR0a.2	' 1=ISD powered up
    isEOM		VAR SR0a.3	' 1=EOM detected (clear by CLR_INT command)
    isINT 		var SR0a.4	' 1=current operation completed (clear by CLR_INT command)
    
    isReady 	var SR1.0	' 1=Ready to receive SPI command (only valid after ReadStatus)
    				        ' Some SPI commands can still be sent when isReady=0
    
    '*************************************************************
    '*************************************************************
    '******************** PIN ASSIGNMENTS ************************
    '*************************************************************
    '*************************************************************
    Symbol sensor	= PORTA.0			' 
    Symbol miso		= PORTA.3			'ISD1760 SPI MISO 
    Symbol led1	    = PORTC.1			'  
    Symbol led2	    = PORTC.2			'
    Symbol ss		= PORTC.3			'ISD1760 SLAVE SELECT  
    Symbol sclk		= PORTC.4			'ISD1760 SPI CLOCK 
    Symbol mosi 	= PORTC.5         	'ISD1760 SPI MOSI	
    	
    '*************************************************************
    '*************************************************************
    '******************** INITIALIZATION *************************
    '*************************************************************
    '*************************************************************
    initialize:
        CLEAR
    	OSCCON = %01111000
    	CMCON0 = 7				'turn off comparators
    	ANSEL = 0
    	
    	PR2 = 35				'PWM Period (40K=49, 56K=35) (35 to 55)
    	CCPR1L = 15				'PWM Duty Cycle (1 to 15)
    	T2CON = 4				'Timer2 = ON; Prescale = 1:1
    	CCP1CON = 0				'PWM module off
    	OPTION_REG = %11111111	'Turn off PortA weak pull-ups
    	
    	TRISA = %111111    		'set PortA directions
    	WPUA =  %000000			'enable weak pull-ups PortA
    	IOCA =  %000000			'disable PORTA.0 Int On Change
    
    	TRISC = %000000    		'set PortC directions
    
    	PORTA = %000000
    	PORTC = %000000    		'
    	
    	HIGH ss			'start with Slave Select HIGH
    	HIGH sclk		'start with SPI Clock HIGH
    	LOW MOSI		'start with MOSI LOW
    	
        INPUT sensor
    	LOW led1
    	LOW led2
    	
    	
    start:                       'Initialize the ISD
    	GoSub isd_pu
    	PAUSE 50		         '50 mS Power Up Delay (per datasheet)
    	GoSub isd_wr_apc 	     'set volume and config bits 
    	PAUSE 10
    	GoSub isd_clr_int	     'clear interrupt and EOM
    '*************************************************************	
    '*************************************************************
    '********************* MAIN PROGRAM **************************
    '*************************************************************
    '*************************************************************
    main_loop:	'(MAIN PROGRAM LOOP)
         
        PAUSE 2000
        
        s_addr = $010
        e_addr = $02b
        GOSUB isd_set_play
    
        PAUSE 2500
        
        GOSUB isd_stop
        
        PAUSE 2000
        
        s_addr = $02c
        e_addr = $048
        GOSUB isd_set_play
        
        PAUSE 2500
    
        GOSUB isd_stop
        
        PAUSE 2000
            
        s_addr = $049
        e_addr = $07c
        GOSUB isd_set_play
        
        PAUSE 4800
    
        GOSUB isd_stop
        
        PAUSE 2000
            
        s_addr = $07d
        e_addr = $093
        GOSUB isd_set_play
        
        PAUSE 2000
    
        GOSUB isd_stop
            
    	GoTo 	main_loop
    
    
    '*************************************************************	
    '*************************************************************
    '********************** SUBROUTINES **************************
    '*************************************************************
    '*************************************************************
    isd_pu:				
    	LOW ss
    
    	bSPI=$01		'Power Up Command
    	GoSub isd_spi
    	ISD_Data[0] = bSPI 	'SR0a
    
    	bSPI=$00
    	GoSub isd_spi
    	ISD_Data[1] = bSPI 	'SR0b
    
    	HIGH ss
    
    	RETURN
    
    '--------------------------------------------------------------------------
    isd_wait_ready:
    	GOSUB isd_rd_status
    	IF isReady = 0 THEN isd_wait_ready
    	RETURN
    
    '--------------------------------------------------------------------------
    isd_set_play:
    	LOW ss
    
    	bSPI = $80		'Set Play Command (7 bytes)
    	GoSub isd_spi
    	ISD_Data[0] = bSPI	'SR0a
    
    	bSPI = $00 
    	GoSub isd_spi
    	ISD_Data[1] = bSPI 	'SR0b
    
    	bSPI = s_addr.LowByte 	' Start Address low byte. 
    	GoSub isd_spi
    	ISD_Data[2] = bSPI	'SR0a
    
    	bSPI = s_addr.HighByte 	' Start Address high byte 
    	GoSub isd_spi
    	ISD_Data[3] = bSPI 	'SR0b
    
    	bSPI = e_addr.LowByte 	' End Address low byte 
    	GoSub isd_spi
    	ISD_Data[4] = bSPI 	'SR0a
    
    	bSPI = e_addr.HighByte 	' End Address high byte
    	GoSub isd_spi
    	ISD_Data[5] = bSPI 	'SR0b
    
    	bSPI = $00		' Reserved Address - set to "0"
    	GoSub isd_spi
    	ISD_Data[6] = bSPI 	'SR0a
    
    	HIGH ss
    
    	RETURN
    
    '--------------------------------------------------------------------------
    isd_wr_apc:			'Write to APC Register using bits D2:D0 to set Volume 
    	LOW ss
    
    	bSPI = $65		'Write APC2 
    	GoSub isd_spi
    	ISD_Data[0] = bSPI 	'SR0a
    
    	bSPI = %01000011	'Volume set by D2:D0 (000=Max)
    				'Output set by D7 (0=Aud, 1=Aux)
    	GoSub isd_spi
    	ISD_Data[1] = bSPI 	'SR0b
    					
    	bSPI = %00000100 	'PWM Speaker Output D8 (0=Enable, 1=Disable)
    				
    	GoSub isd_spi
    	ISD_Data[2] = bSPI 	'SR0a
    
    	HIGH ss
    
    	RETURN
    
    '--------------------------------------------------------------------------
    isd_spi:				        ' shift SPI data out and into SPI byte 
    	FOR spi_cnt = 0 to 7        '
    		MOSI = bSPI.0 		    ' shift LSB of byte onto MOSI line
    		LOW SCLK 		        ' clock MISO data out to uC (Falling Edge)
    		temp_bit = miso         '
    		HIGH SCLK		        ' clock MOSI into ISD1700 (Rising Edge)
    		bSPI = bSPI >> 1 		' shift SPI byte Right
    		bSPI.7 = temp_bit
    	NEXT spi_cnt
    
    	RETURN
    
    '--------------------------------------------------------------------------
    isd_clr_int:					' CLEAR INTERRUPT AND EOM BITS
    	LOW SS
    	
    	bSPI=$04		'Clear Interrupt Command
    	gosub isd_spi
    	ISD_Data[0] = bSPI 	'SR0a
    
    	bSPI=$00
    	gosub isd_spi
    	ISD_Data[1] = bSPI 	'SR0b
    
    	HIGH SS
    
    	RETURN
    
    '--------------------------------------------------------------------------
    isd_stop:					' Stop Immediately
    	LOW ss
    
    	bSPI=$02		'Stop Command
    	gosub isd_spi
    	ISD_Data[0] = bSPI 	'SR0a
    
    	bSPI=$00
    	gosub isd_spi
    	ISD_Data[1] = bSPI 	'SR0b
    
    	HIGH ss
    
    	RETURN
    
    '--------------------------------------------------------------------------
    isd_pd:					' Stop Immediately
    	LOW ss
    
    	bSPI=$07		'Power Down Command
    	gosub isd_spi
    	ISD_Data[0] = bSPI 	'SR0a
    
    	bSPI=$00
    	gosub isd_spi
    	ISD_Data[1] = bSPI 	'SR0b
    
    	HIGH ss
    
    	RETURN
    
    '--------------------------------------------------------------------------
    isd_rd_status:				'read status of ISD1700 
    	LOW ss
    
    	bSPI=$05		'Read Status Command
    	gosub isd_spi
    	ISD_Data[0] = bSPI	'SR0a
    
    	bSPI=$00
    	gosub isd_spi
    	ISD_Data[1] = bSPI	'SR0b
    
    	bSPI=$00
    	gosub isd_spi
    	ISD_Data[2] = bSPI	'SR1
    
    	HIGH ss
    
    	RETURN
    
    '*************************************************************
    '*************************************************************
    
    
    	End

  16. #56
    spolk10's Avatar
    spolk10 Guest


    Did you find this post helpful? Yes | No

    Default Re: Getting Close But Not Quite There

    Quote Originally Posted by ams0178 View Post
    Hey Guys,

    I'm getting close but I'm not quite there. I have the audio chip recording and playing because the LED is constant during recording and blinks during playing. But unfortunately I'm not getting anything out of the speaker except a small hum. I've documented my setup of what I'm doing below. I'm a little bit unfamiliar with audio signals so its certainly possible that I might be doing something wrong.

    I'm using the audio in pin which has a 0.1uF cap on it as recommended in the datasheet. Once powered up in SPI mode, the ISD17000 should assumes that the audio input is from this pin and not the microphone, (If I read the design guide correctly). I'm trying to put a simple audio output signal from my PC tower into this pin. I cut off the end of a wire that has an audio jack on the one end. There was a red wire and a white wire inside that I stripped down to the wire. I tested the output audio signals with an oscilloscope and they're between +/- 1 Volt. I didn't think it mattered which wire I soldered to the audio input pin on my board because as far as I know audio is just a differential signal, right? But currently the white wire is soldered to the input pin. And I tied the red wire to ground. I even monitored the input signals here as I recorded them and saw the input on the oscilloscope. But when I go to play back the recording, the speaker just hums as if there was only a very faint sound.

    Does anybody know what I'm doing wrong? Any suggestions for troubleshooting? I'm not sure what to check next.

    Thanks, Alan
    Alan,
    I am having the same problem. What did you do to fix this?
    Scott

  17. #57
    Join Date
    May 2013
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: Winbond ISD1700 Voice Recorder

    I implemented hardware SPI using a PIC 16F877A and an ISD1740. I do it with ASM, but you can translate it to PICBasic if needed.

    I'm posting it here because is the most extensive thread in the subject I could found, and I haven't found information about how to do it by hardware anywhere. I haven't finish yet, but I will probably forget to post it here late, so here goes what I've done so far.

    As PIC SPI is Msb -> Lsb and ISD1700 is Lsb -> Msb, everything is inverted.
    Code:
    ISD commands:
    
    ;ISD led active on all the commands, for debugging, set bit 3 to 0 to disable ISD led flashing
    
    CONSTANT SND_CMD_PU        = b'10001000'
    CONSTANT SND_CMD_SET_PLAY  = b'00001001'
    CONSTANT SND_CMD_SET_REC   = b'10001001'
    CONSTANT SND_CMD_PD        = b'11101000'
    CONSTANT SND_CMD_CLR_INT   = b'00101000'
    CONSTANT SND_CMD_WR_APC2   = b'10101110'
    CONSTANT SND_CMD_WR_NVCFG  = b'01101010'
    CONSTANT SND_CMD_RD_STATUS = b'10101000'
    
    ;PIC ISD ports and pins
    
    		CONSTANT	SND_PUERTO_ES			=	PORTC
    		CONSTANT	SND_CONTROL_ES			=	TRISC
    		CONSTANT	SND_PIN_E			=	.4
    		CONSTANT	SND_PIN_S			=	.5
    		CONSTANT	SND_PUERTO_CLK			=	PORTC
    		CONSTANT	SND_CONTROL_CLK			=	TRISC
    		CONSTANT	SND_PIN_CLK			=	.3
    		CONSTANT	SND_PUERTO_SS			=	PORTA
    		CONSTANT	SND_CONTROL_SS			=	TRISA
    		CONSTANT	SND_PIN_SS			=	.5
    
    
    ;SPI configuration and activation
    
    		;PORTS config
    		banksel		SND_CONTROL_ES
    		BCF		SND_CONTROL_ES,SND_PIN_S
    		BSF		SND_CONTROL_ES,SND_PIN_E
    		banksel		SND_CONTROL_CLK
    		BCF		SND_CONTROL_CLK,SND_PIN_CLK
    		banksel		SND_PUERTO_ES
    		BCF		SND_PUERTO_ES,SND_PIN_S
    		banksel		SND_PUERTO_CLK
    		BSF		SND_PUERTO_CLK,SND_PIN_CLK
    		;SPI config
    		banksel		PIE1
    		BSF		PIE1,SSPIE		;enable interrupt
    		banksel		SSPSTAT
    		MOVLW		b'00000000'
    		MOVWF		SSPSTAT
    		;SSPM3:0 = 0001 = Fosc/16
    		banksel		SSPCON
    		MOVLW		b'00110001'
    		MOVWF		SSPCON
    		;use SS to signal command start/stop
    		banksel		SND_CONTROL_SS
    		BCF		SND_CONTROL_SS,SND_PIN_SS
    		banksel		SND_PUERTO_SS
    		BSF		SND_PUERTO_SS,SND_PIN_SS
    
    ;SPI usage if not using interrupts
    
    ;active waiting for SPI transmission to end
    snd_debug_esperar
    		banksel		SSPSTAT
    		BTFSS		SSPSTAT,BF
    		GOTO		snd_debug_esperar
    		BCF		SSPSTAT,BF
    		RETURN
    
    ;SPI without interrupts, to verify it works
    snd_debug
    		;it has to be already configured, I'm ignoring ISD response
    		banksel		SND_PUERTO_SS
    		BCF		SND_PUERTO_SS,SND_PIN_SS ;start command
    		banksel		SSPBUF
    		MOVLW		SND_CMD_PU ;first byte
    		MOVWF		SSPBUF
    		CALL		snd_debug_esperar
    		banksel		SSPBUF
    		MOVFW		SSPBUF
    		CLRW
    		MOVWF		SSPBUF
    		call		snd_debug_esperar
    		banksel		SND_PUERTO_SS
    		BSF		SND_PUERTO_SS,SND_PIN_SS
    		;enviar un SET_PLAY
    		pagesel		snd_debug
    		banksel		SND_PUERTO_SS
    		BCF		SND_PUERTO_SS,SND_PIN_SS
    		MOVLW		SND_CMD_SET_PLAY
    		banksel		SSPBUF
    		MOVWF		SSPBUF
    		CALL		snd_debug_esperar
    		banksel		SSPBUF
    		MOVFW		SSPBUF
    		CLRW
    		MOVWF		SSPBUF
    		call		snd_debug_esperar
    		banksel		SSPBUF
    		MOVFW		SSPBUF
    		MOVLW		b'0000100' ; 0x10 inverted
    		MOVWF		SSPBUF
    		call		snd_debug_esperar
    		banksel		SSPBUF
    		MOVFW		SSPBUF
    		MOVLW		0x00
    		MOVWF		SSPBUF
    		call		snd_debug_esperar
    		banksel		SSPBUF
    		MOVFW		SSPBUF
    		MOVLW		b'0111111' ; 0x7E inverted
    		MOVWF		SSPBUF
    		call		snd_debug_esperar
    		banksel		SSPBUF
    		MOVFW		SSPBUF
    		MOVLW		0x00
    		MOVWF		SSPBUF
    		call		snd_debug_esperar
    		banksel		SSPBUF
    		MOVFW		SSPBUF
    		CLRW
    		MOVWF		SSPBUF
    		call		snd_debug_esperar
    		banksel		SND_PUERTO_SS
    		BSF		SND_PUERTO_SS,SND_PIN_SS
    		return
    Sorry for the code format, I couldn't find a way to post it properly formatted.

    DAvid

  18. #58
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Winbond ISD1700 Voice Recorder

    I tried to play a recorded sound on ISD1730 but something is wrong. I use 16F1503 set at 4 MHZ. Can somebody help me..? Thx in advance


    CODE:

    #CONFIG
    __config _CONFIG1, _FOSC_INTOSC & _MCLRE_OFF & _CP_ON & _CLKOUTEN_OFF
    __config _CONFIG2, _LVP_OFF & _LPBOR_OFF
    #ENDCONFIG

    DEFINE OSC 4
    OSCCON = %01101000 ' set 4MHz internal osc


    CM1CON0.7 = 0 ; Disable comparator 1
    CM2CON0.7 = 0 ; Disable comparator 2

    ADCON0 = 0 'all ports set as digital
    ADCON1 = 0

    TRISA = %00100000 'PORTA.5 as input
    ANSELA = %00000000
    PORTA = 0

    TRISC = %00000100 'PORTC.3 as input
    LATC = 0
    PORTC = 0
    ANSELC = 0


    '******************** DEFINE VARIABLES ***********************

    temp_bit VAR BIT

    temp VAR BYTE
    spi_cnt var byte ' counter for SPI transfer
    bSPI var byte ' the byte being transferred on SPI

    s_addr VAR WORD ' Start Address
    e_addr VAR WORD ' End Address

    ISD_Data var byte[7] ' This array contains data to/from ISD

    SR0a var ISD_Data[0]
    SR0b var ISD_Data[1]
    SR1 var ISD_Data[2] ' only valid after ReadStatus

    isCmdErr var SR0a.0 ' 1=previous command failed/ignored
    isFull var SR0a.1 ' 1=memory full
    isPU var SR0a.2 ' 1=ISD powered up
    isEOM VAR SR0a.3 ' 1=EOM detected (clear by CLR_INT command)
    isINT var SR0a.4 ' 1=current operation completed (clear by CLR_INT command)

    isReady var SR1.0 ' 1=Ready to receive SPI command (only valid after ReadStatus)
    ' Some SPI commands can still be sent when isReady=0


    '******************** PIN ASSIGNMENTS ************************


    Symbol LED = PORTA.0 '
    Symbol miso = PORTC.2 'ISD1730 SPI MISO
    Symbol ss = PORTC.3 'ISD1730 SLAVE SELECT
    Symbol sclk = PORTC.1 'ISD1730 SPI CLOCK
    Symbol mosi = PORTC.0 'ISD1730 SPI MOSI

    '******************** INITIALIZATION *************************
    initialize:

    HIGH ss 'start with Slave Select HIGH
    HIGH sclk 'start with SPI Clock HIGH
    LOW MOSI 'start with MOSI LOW
    LOW led


    start: 'Initialize the ISD
    GoSub isd_pu
    PAUSE 50 '50 mS Power Up Delay (per datasheet)
    GoSub isd_clr_int 'clear interrupt and EOM


    '********************* MAIN PROGRAM **************************

    main_loop: '(MAIN PROGRAM LOOP)

    Playloop:
    if porta.5 = 1 then play
    goto playloop

    Play:
    high led ' LED for play

    if porta.5 = 1 then play 'wont play until button is released

    s_addr = $010 'playing back from the same 16 rows
    e_addr = $01f

    GOSUB isd_set_play

    PAUSE 2000

    GOSUB isd_stop

    low led
    goto main_loop
    end

    '********************** SUBROUTINES **************************
    isd_pu:
    LOW ss
    bSPI=$01 'Power Up Command
    GoSub isd_spi
    ISD_Data[0] = bSPI 'SR0a
    bSPI=$00
    GoSub isd_spi
    ISD_Data[1] = bSPI 'SR0b
    HIGH ss
    RETURN

    '--------------------------------------------------------------------------
    isd_wait_ready:
    GOSUB isd_rd_status
    IF isReady = 0 THEN isd_wait_ready
    RETURN

    '--------------------------------------------------------------------------
    isd_set_play:
    LOW ss

    bSPI = $80 'Set Play Command (7 bytes)
    GoSub isd_spi
    ISD_Data[0] = bSPI 'SR0a

    bSPI = $00
    GoSub isd_spi
    ISD_Data[1] = bSPI 'SR0b

    bSPI = s_addr.LowByte ' Start Address low byte.
    GoSub isd_spi
    ISD_Data[2] = bSPI 'SR0a

    bSPI = s_addr.HighByte ' Start Address high byte
    GoSub isd_spi
    ISD_Data[3] = bSPI 'SR0b

    bSPI = e_addr.LowByte ' End Address low byte
    GoSub isd_spi
    ISD_Data[4] = bSPI 'SR0a

    bSPI = e_addr.HighByte ' End Address high byte
    GoSub isd_spi
    ISD_Data[5] = bSPI 'SR0b

    bSPI = $00 ' Reserved Address - set to "0"
    GoSub isd_spi
    ISD_Data[6] = bSPI 'SR0a

    HIGH ss

    RETURN

    '--------------------------------------------------------------------------
    isd_spi: ' shift SPI data out and into SPI byte
    FOR spi_cnt = 0 to 7 '
    MOSI = bSPI.0 ' shift LSB of byte onto MOSI line
    LOW SCLK ' clock MISO data out to uC (Falling Edge)
    temp_bit = miso '
    HIGH SCLK ' clock MOSI into ISD1700 (Rising Edge)
    bSPI = bSPI >> 1 ' shift SPI byte Right
    bSPI.7 = temp_bit
    NEXT spi_cnt

    RETURN

    '--------------------------------------------------------------------------
    isd_clr_int: ' CLEAR INTERRUPT AND EOM BITS
    LOW SS

    bSPI=$04 'Clear Interrupt Command
    gosub isd_spi
    ISD_Data[0] = bSPI 'SR0a

    bSPI=$00
    gosub isd_spi
    ISD_Data[1] = bSPI 'SR0b

    HIGH SS

    RETURN

    '--------------------------------------------------------------------------
    isd_stop: ' Stop Immediately
    LOW ss

    bSPI=$02 'Stop Command
    gosub isd_spi
    ISD_Data[0] = bSPI 'SR0a

    bSPI=$00
    gosub isd_spi
    ISD_Data[1] = bSPI 'SR0b

    HIGH ss

    RETURN

    '--------------------------------------------------------------------------
    isd_rd_status: 'read status of ISD1700
    LOW ss '

    bSPI=$05 'Read Status Command
    gosub isd_spi
    ISD_Data[0] = bSPI 'SR0a

    bSPI=$00
    gosub isd_spi
    ISD_Data[1] = bSPI 'SR0b

    bSPI=$00
    gosub isd_spi
    ISD_Data[2] = bSPI 'SR1

    HIGH ss

    RETURN

  19. #59
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: ISD17240PY Project

    I found the problem ..

    TRISC = %00000000

    Now all is ok !

Similar Threads

  1. ISD1700 series Winbond chipcorder
    By rickeybell in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 21st March 2010, 07:13
  2. optical voice link
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th May 2008, 22:11
  3. Voice CODEC
    By Ron Marcus in forum Off Topic
    Replies: 0
    Last Post: - 15th May 2005, 20:28

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts