Here's what I use in the BrailleMaster (http://www.braillemaster.biz). Harold ;------------------ISD Speech Chip Routines--------------------------------------------- ISDPlayTxMidLo ; Load TxMid/TxLo into ISD, then play it call ISDsetPlay goto ISDplay ISDpowerUp ; Send power up command to ISD chip. if isd==4003 movlw b'00100000' ; Power up command 0f 00100 with lower bits don't care movwf TxMid goto SPI endif if isd==4004 movlw 0x20 movwf TxHi goto SPIsendHi ; Send just the high byte endif ISDsetPlay ; Set the play address. if isd==4003 ;Preload the 11 bits of address in TxMid/TxLo. movfw TxMid ; Get high address andlw 0x07 ; Clear bits higer than valid range addlw b'11100000' ; Add in set play command movwf TxMid goto SPI endif if isd==4004 ; Just set TxHi, leaving TxMid and TxLo alone movlw 0xe0 movwf TxHi goto SPI ; Send 3 bytes endif ISDplay ; Start playing at address set by ISDsetPlay. Stop at EOM or overflow ; call WaitEOM ISDplayNoWait if isd==4003 movlw b'11110000' movwf TxMid goto SPI endif if isd==4004 movlw 0xf0 movwf TxHi goto SPIsendHi ; Send just the high byte endif ISDstop ; Stop the current action. if isd==4004 movlw 0x03 movwf TxHi goto SPisendHi ; Send and return endif return ; Just return if ISD4003 ISDpowerDown ; Shut the chip down. if isd==4003 movlw b'00010000' movwf TxMid goto SPI endif if isd==4004 movlw 0x01 movwf TxHi goto SPIsendHi endif WaitEOM ; Wait for EOM from ISD chip. Includes a timeout in case it's missed cblock eomLo eomMid eomHi ; Timers for timeout endc clrf eomLo clrf eomMid clrf eomHi ; Clear the timer WaitEOMa btfss portb,0 ; See if ISD has sent an interrupt (indicating EOM) return ; Got it, exit decfsz eomLo,1 goto WaitEOMa ; Go around again clrwdt decfsz eomMid,1 goto WaitEOMa ; To around again unless we timed out decfsz eomHi,1 goto WaitEOMa ; To around again unless we timed out return ; Give up waiting for EOM SPI ; Performs an SPI data exchange with the ISD4003. ISD4003 uses LO and MID registers (16 bits). ISD4004 uses 24 bits cblock TxLo ; Low byte to be transmitted to ISD4003 TxMid TxHi TxRot ; Rotate bits out of this register to avoid destroying Tx registers RxLo ; Low byte received from ISD4003 RxMid RxHi RxRot ; Rotate bits into this register as received SPIbitCount endc SPInoWait bcf lata,3 ; -SS low, starting cycle movfw TxLo ; Get low byte to transmit movwf TxRot ; and get ready to shift it out call DoSPIbyte ; Go send it movfw RxRot movwf RxLo ; Save the received byte movfw TxMid movwf TxRot ; Get mid byte to rotate out call DoSPIbyte movfw RxRot movwf RxMid ; Save received byte ; more stuff here for 4004 if isd==4004 SPIsendHi ; Late entry point to send just one byte (TxHi) bcf lata,3 ; -SS low (if not already low) movfw TxHi movwf TxRot ; Get hi byte to rotate out call DoSPIbyte movfw RxRot movwf RxHi ; Save received byte endif bsf lata,3 ; -SS high return DoSPIbyte ; Send byte in TxRot and receive byte into RxRot movlw 0x08 movwf SPIbitCount ; Initialize the bit counter for low byte SPIa clrc ; Assume bit is low btfsc porta,1 setc ; Set carry if incoming data bit was high rrf RxRot,1 ; Rotate into receive register rrf TxRot,1 ; Rotate first bit to transmit into carry skpc bcf lata,0 ; Bit was clear, so clear output bit skpnc bsf lata,0 ; Bit was set, so set output bit nop ; Let output port settle bsf lata,2 ; Clock line high nop bcf lata,2 ; Clock line low nop decfsz SPIbitCount,1 ; Loop 'til 8 bits sent and received. goto SPIa return On Thu, 23 May 2002 20:05:46 +0000 Thomas N writes: > Hello everyone, > > I am building a Digital Recorder module. This module contains a > PIC16F876 > and a ISD4004-08. Anyone has interface routines for the ISD4004 IC? > If you > do, please forward me a copy. It would save me lots of time! > > Thank you in advance! > Best regards, > Thomas > > > _________________________________________________________________ > Send and receive Hotmail on your mobile device: > http://mobile.msn.com > > -- > http://www.piclist.com hint: The list server can filter out > subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > FCC Rules Online at http://hallikainen.com/FccRules Lighting control for theatre and television at http://www.dovesystems.com ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/web/. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.