Winbond ISD1700 Voice Recorder


Closed Thread
Results 1 to 40 of 59

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    Hi Gary

    Good to know you have figured it out. You have yourself to thank for the patience and dedication to figure it out.

    Regards

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Thanks Jim for the tips. OK, I will try a bit more without beeing prejudiced.

    Gary: If you areallowed can you post the working code?

    Thanks,

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Ok... here's the code

    hey Ioannis,
    here is my code that I have working. I am using my own RFEFX board which includes an RF. If you have any questions please don't hesitate to ask. after i cleaned up some of Jim's code, as I have a different platform, the lights kinda just went off in my head and it all became real easy. For Video Click Here (9MB File takes a min to load)

    Code:
    '****************************************************************
    '*  Name    : ISD17XX.BAS                                       
    '*  Authors : Jerson,Brenon,Jim,Gary                            
    '****************************************************************
    
    define OSC 20
    
    Time1 var word          'these variables used for the Erase flash
    Time2 var byte          'LEDS when the device is erased
                            'used in Label - FlashLED:
    time1 = 5000
    time2 = 50
    
    '******************** 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 miso		= PORTC.5			'ISD1760 SPI MISO 
    Symbol LED1	    = PORTA.5			'  
    Symbol LED2	    = PORTA.0			'
    Symbol ss		= PORTC.7			'ISD1760 SLAVE SELECT  
    Symbol sclk		= PORTC.4			'ISD1760 SPI CLOCK 
    Symbol mosi 	= PORTC.6         	'ISD1760 SPI MOSI	
    
    '******************** INITIALIZATION *************************
    initialize:
    
      ' Im using a PIC 16F876A with an external 20 MHZ clock
      ' there is really little setup. 
    
        	
    	HIGH ss			'start with Slave Select HIGH
    	HIGH sclk		'start with SPI Clock HIGH
    	LOW  MOSI		'start with MOSI LOW
    	
    	LOW LED1
    	LOW led2
    	
    	
    start:                       'Initialize the ISD
    	GoSub isd_pu
    	PAUSE 50		         '50 mS Power Up Delay (per datasheet)
    	
           'I removed the APC because it doesn't work on my Audio Board 
        
    	PAUSE 10
    	GoSub isd_clr_int	     'clear interrupt and EOM
    	
    	gosub erase              'this will erase the ISD chip whenever
    	                         'I reprogram my PIC
    	
    	
    
    '********************* MAIN PROGRAM **************************
    
    main_loop:	'(MAIN PROGRAM LOOP)
         
        PAUSE 2000
        
    RecordLoop:                       'Here is my board waiting for me to 
        if portc.3 = 1 then Record       'push the record button
        goto recordLoop
        
    Record:
    
        high led1                   'a record LED
        
        if portc.3 = 1 then record  'it will not continue until i 
                                       'release the button
        
        s_addr = $010               'a 1 second clip takes approx 16 rows of 
        e_addr = $01f               'memory space $010-$01F = 16
        
        GOSUB isd_set_rec           'this Set_rec identical to set_play
                                    'was added so i could record a message
                                    
        
        PAUSE 2000    
        
        GOSUB isd_stop              ' an immediate stop to stop recording
        
        low led1                    ' turn record LED off
          
    
    Playloop:                       'the same button then becomes a play button
        'pause 2000
        if portc.3 = 1 then play
        goto playloop
    
    Play:
        high led2                   'a different LED for play
        
        if portc.3 = 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 led2
        
    Eraseloop:                       
        'pause 2000                  
        if portc.3 = 1 then play     'in this loop you can either play the sound
        if portc.5 = 1 then erase    'again or erase it and record another one
        goto Eraseloop               'two different buttons are used
    
    Erase:                           'this is the erase subroutine which is also 
        if portc.5 = 1 then erase    'called at the beginning of this program
        s_addr = $010                'this is not a Gang erase so the Start and
        e_addr = $01f                'End address must be present or you will get
        GOSUB isd_set_erase          'a command error
        
        gosub flashLED               'when i erase the chip a series of LEDS
                                     'are flased to indicate an erase.
        pause 1000
                    
        goto recordloop              'after an erase it goes back to record 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_Set_Erase:
    	LOW ss
    
    	bSPI = $82		           'Set Erase 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_set_rec:
    	LOW ss
    
    	bSPI = $81		           'Set Record 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
    
    '*********** Erase Indicators ********************************
    FlashLED:
        pulsout porta.5,time1
        pause time2
        pulsout porta.3,time1
        pause time2
        pulsout porta.2,time1
        pause time2
        pulsout porta.1,time1
        pause time2
        pulsout porta.0,time1
        pause time2
        low porta.0
    return   
    
    End
    There are 10 kinds of people. Those that know binary and those that do not.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Hi Gary.

    Thanks a lot for your sample code.

    Nice work with the pcb's too!

    Your video was downloaded in less than 9 sec, for the records.

    Also your introduction to the site is quite impressive. Waiting to see the rest! Did you do this your own?

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    Hey Ioannis,
    Thanks a lot for your feedback. I do understand Flash websites, but in all honesty, it took

    me 5 hours modifying that flash intro template to my liking. i couldnt imagine coding the

    entire thing from scratch. Although "If there is a will. There is a way."

    The website will be based on the same flash template arcitecture and i cant imagine how long

    that is going to take me to modify.

    But yeah, thanks for the feed back and I hope you like the site when its available...

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

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default

    Hi Gary.

    1. Do you have any newer design guide for the ISD17xx than the revision 0/2006?

    2. What do you use for the site you built? Is this template included?

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    The ISD17XXX series is a fairly old device so there have been no changes to it. therefore I

    believe the design guide would not change. the design guides are somewhat difficult to get.

    I had to tell Winbond that my company (the one I was working for at the time) that we were

    going to use about 500,000 devices a year.... so they quickly sent over their design guide.

    As far as the flash template modification, I use MXStudio 2004 (photo Attached) and I just

    downloaded a free Flash intro template and modified it to my liking.

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

Similar Threads

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

Members who have read this thread : 0

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