Below is the code currently driving the ISD4003-08M in the BrailleMaster (http://www.braillemaster.biz). It's running on an 18c252, but should be easily moved to any other PIC (mostly change the lat to port). It bit bangs the SPI. I originally used the ISD4003, then changed to the ISD4004, so there's some conditionally assembly to keep the two straight. Once I moved to the ISD4004, I did no further testing on the ISD4003, so it may or may not work at this point. But, the ISD4004 code definitely works! 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 Sat, 23 Mar 2002 04:59:54 +0530 Viral Purohit writes: > I would also be interested to know about the project with ISD4004. > Please share this info with all of us instead of contacting the user > off-list. > Regards, > Viral > http://www.circuitsonweb.com > ----- Original Message ----- > From: "Harold Hallikainen" > To: > Sent: Friday, March 22, 2002 11:59 AM > Subject: Re: [EE]: ISD 4003-4004 chipcorder source code? > > > > I can send you some ISD4004 code next week when I'm back in the > office. > It's used in the BrailleMaster (http://www.braillemaster.biz). > > > > Harold > > > > > > > > > > ________________________________________________________________ > > 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: To leave the PICList > > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > > > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > 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#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body