Exact match. Not showing close matches.
PICList
Thread
'[PIC] SPI ISDs and PIC'
2008\01\02@030916
by
Jinx
Does anyone have code examples for the SPI ISD chips, in my
case the ISD5008. I'm upgrading a product from the smaller ISDs
which use the A0-7 interface. Working through the manual but
would like to see how it's been done before and also any gotchas
For example, 01110000 is given as the instruction code for both
STOP and RINT. Might be true, still browsing. Can't see any
appnotes or errata at Winbond
TIA
==========================================
For a successful technology, reality must take precedence over
public relations, for nature cannot be fooled
2008\01\02@115110
by
Harold Hallikainen
|
> Does anyone have code examples for the SPI ISD chips, in my
> case the ISD5008. I'm upgrading a product from the smaller ISDs
> which use the A0-7 interface. Working through the manual but
> would like to see how it's been done before and also any gotchas
>
> For example, 01110000 is given as the instruction code for both
> STOP and RINT. Might be true, still browsing. Can't see any
> appnotes or errata at Winbond
>
> TIA
>
Here's some bit banged SPI ISD code used in the http://www.brailletutor.com
;------------------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
Harold
--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!
2008\01\02@163400
by
Jinx
2008\01\05@213535
by
Jinx
Harold, what voltage do you run the ISD400x at ? Although the
specs say 2.7V to 3.3V, I notice the absolute max is 7V, which
seems like a high enough ceiling to use 4-5V, more in line with
the PIC and the rest of the 5V system. Perhaps maybe power it
via a diode for a bit of a drop rather than have another regulator.
Which would be the desirable thing to do, it just seems the margin
between recommended and absolute seems rather wide
One reason I ask is that a series of receiver/transmitter pairs I use
are also specced at 3V/5V in the datasheet, but in fact will work at up
to 12V. For some reason, probably to emphasise that they can
work satisfactorily with a couple of batteries, only 3V/5V is ever
mentioned in the original, sketchy, datasheet, and that 3V/5V has
been quoted ever after in other datasheets
2008\01\06@103954
by
Harold Hallikainen
2008\01\06@154918
by
Jinx
> I ran it at 3V. I've posted the schematic at
> http://sujan.hallikainen.org/temp/schematic.pdf
Thanks. Although the 5008 has more internal modules, it's similar
in basic function to the 400x. I've had one sitting around here for
a couple of years. It may have come from Russell. Turned out to
be handy having one to hand anyway
> I haven't looked at the datasheet in a while. I don't recall the
> 7V absolute max. That's pretty high!
It is when you compare it with the 3.6V max for an LF PIC. 7V
seems to me to be more in line with a 5V Vcc
If I had two of the 5008 I'd be trying it at 5V. For now, 3V. I'll
drop a line to Winbond, see if they have any comment
2008\01\07@145528
by
Jinx
> I don't recall the 7V absolute max. That's pretty high!
>
> Harold
Got this *thorough explanation* from Winbond
---------------------------------------
From: UL20 Aditya Raina
Sent: Monday, January 07, 2008 10:33 AM
To: UK10 Eden Liao
Cc: UK10 Chin-Shu Lin; UK10 Mike Luh
Subject: RE: ISD5008 Vcc question
No. It will only work from 2.7--3.3V
Thanks
Aditya
2008\01\07@162218
by
Harold Hallikainen
I guess it does not burst into flames at 7V, but will not work there either.
Harold
{Quote hidden}>> I don't recall the 7V absolute max. That's pretty high!
>>
>> Harold
>
> Got this *thorough explanation* from Winbond
>
> ---------------------------------------
>
> From: UL20 Aditya Raina
> Sent: Monday, January 07, 2008 10:33 AM
> To: UK10 Eden Liao
> Cc: UK10 Chin-Shu Lin; UK10 Mike Luh
> Subject: RE: ISD5008 Vcc question
>
> No. It will only work from 2.7--3.3V
>
> Thanks
> Aditya
>
> -
2008\01\07@164055
by
Jinx
> I guess it does not burst into flames at 7V, but will not work
> there either
>
> Harold
I realise this is straying into non-[PIC]
The storage array is analogue. If you were to record at 2.7V
and playback at 3.3V ....... ??? Conversely, record with fresh
batteries, does playback change or deteriorate as batteries run
down ?
An exercise I'll try when it's all up and running (at 3V of course)
because I like to know how chips behave, over and above what's
in the datasheet
2008\01\08@112436
by
alan smith
our design ran the PIC at 5V, and the Winbond at 3.3 and the audio amp at 12V.
Jinx <spam_OUTjoecolquittTakeThisOuT
clear.net.nz> wrote: > I ran it at 3V. I've posted the schematic at
> http://sujan.hallikainen.org/temp/schematic.pdf
Thanks. Although the 5008 has more internal modules, it's similar
in basic function to the 400x. I've had one sitting around here for
a couple of years. It may have come from Russell. Turned out to
be handy having one to hand anyway
> I haven't looked at the datasheet in a while. I don't recall the
> 7V absolute max. That's pretty high!
It is when you compare it with the 3.6V max for an LF PIC. 7V
seems to me to be more in line with a 5V Vcc
If I had two of the 5008 I'd be trying it at 5V. For now, 3V. I'll
drop a line to Winbond, see if they have any comment
2008\01\09@222601
by
Jinx
> I haven't looked at the [4003] datasheet in a while
Been struggling to get this 5008 working properly. Don't know if
anyone's working with these at the moment, but just to put this out
there for future reference -
Comparing the 400x and 5008 datasheet, I noticed that the 400x
procedure has an additional POWERUP command before a REC
command. The 5008 manual says one POWERUP will enable the
chip. Doesn't seem to. I added another POWERUP and it came
right. All in all, the ISD datasheets could be (should be) better
For the power supply, 3 x IN914 diodes from PIC's 5V with a 4k7
load keeps the ISD Vcc around 3V. Power-down not required on
this project. ISD could be powered or enabled by the PIC though
Celebrated, in my own humble way, with a recording and playback
of Ian Dury's "There Ain't Half Been Some Clever Bastards" ;-))
clr_ss ;/SS = 0 + 100us delay
mov b'01100000',data_out ;POWERUP
call data8 ;send data
set_ss ;/SS = 1 + 100us delay
call ms50 ;50ms delay (Tpu > 25ms)
;set configs for record
cfg_rec mov b'00001011',cfg0_lo ;0x440b
mov b'01000100',cfg0_hi
mov b'11000001',cfg1_lo ;0x00c1
mov b'00000000',cfg1_hi
call set_cfgs
record prtstr2 recording ;"Recording"
clr_ss ;/SS = 0 + 100us delay
mov b'01100000',data_out ;POWERUP
call data8 ;send data
set_ss ;/SS = 1 + 100us delay
call ms100 ;100ms delay (2 x Tpu > 25ms)
clr_ss
clrf data16_1 ;address = 0
clrf data16_2
call data16 ;send data
usec10
movlw b'10100000' ;record from set address
movwf data_out
call data8
set_ss
2008\01\09@234842
by
Harold Hallikainen
Congratulations on your success! I never tried to directly record on the
ISD chips. I created a BUNCH of audio files, then used a Quadravox
programmer to program the chips. The Quadravox software gives you a list
of the addresses each recording starts at. So, I just had a table of
address I sent the chip.
Harold
--
FCC Rules Updated Daily at http://www.hallikainen.com - Advertising
opportunities available!
2008\01\10@001957
by
Jinx
> Congratulations on your success!
Thanks, it's a great relief to see it doing what the manual says it
should. I thought I might have to go out and buy some frowns
and sighs wholesale !!
> I never tried to directly record on the ISD chips. I created a
> BUNCH of audio files, then used a Quadravox programmer
> to program the chips. The Quadravox software gives you a list
> of the addresses each recording starts at. So, I just had a table
> of address I sent the chip
Part of this project is a message recorder for customers, kind of
voice mail, so I really had to get into the nitty-gritty of the chip. The
addition of INT and RAC indicators is very helpful, although CUEing
to EOM markers will probably do for mail playback at this stage. I'd
have to do a comparison but to my ears the quality sounds better than
the 1400, although the datasheet THD is the same
I'll put it up as a page when it's all sorted out
2008\01\12@174612
by
Jinx
> Congratulations on your success!
Still looking into this. Found a PIClist post from several years
ago in which the solution was also double-instructing, this time
the user was having trouble with playback. David Duffy replied
to this post, appearing to say he has no trouble with the 5008,
with code examples
Might get Winbond to comment on what could be a recognised
glitch. The interface is pretty straight-forward, might be a timing
thing in the chip itself
http://techref.massmind.org/techref/piclist/2001/05/02/193409a.txt
> I resolved yesterday the code, all what I write
> some times ago,it was right but this chip need
> 2 successive access in control registers when
> the settings will be actives. I send 2 successive
> play commands and the chip play the message until
> find the EOM.
> thanks again.
> Miki
2008\01\20@060749
by
Jinx
part 1 2420 bytes content-type:text/plain; (decoded 7bit)
> I never tried to directly record on the ISD chips. I created
> a BUNCH of audio files, then used a Quadravox programmer
I may get a programmer, but for now I've kind of automated the
process. The 25 messages are assembled on the right channel of
Goldwave. Separating them on the left channel are tone bursts.
These are fed into a 567 tone decoder and its output tells the PIC
what data and when to send it to the ISD
(The audio in the picture is actually Dick Clark saying "Two". I
found a New Year countdown mp3 of him and Ed McMahon
which was very useful for testing whether all the messages had
stuck and if they could be recalled correctly)
If the PIC powers up with button1 down, it enters Record mode.
kb_567 looks for a manual button in this mode
;Pushbuttons in Record mode
;Diode-steered into high nybble of PortD
;Play at 00 button1
;Play at current address button2
;Record at 00 button3
;Record at current address button4
;Stop button5
;Cue to next message button6
;Exit button7
;spare button8
kb_567 movfw portd
swapf wreg
andlw b'00001111'
skpz ;no button pressed
bra rec_234 ;button down, decode and release
lp567 btfss ne567 ;rising edge
bra kb_567 ;no tone
prtstr2 stopped ;print "Stopped"
clr_ss
movlw b'01110000' ;stop command
movwf data_out
call data8
set_ss
call ms100
btfsc ne567 ;falling edge
bra $-2
btfsc first ;first message, record at 00
bra recatxx ;not first
bsf first
recat00 prtstr2 record00 ;print "Record at 00"
clr_ss
clrf data16_1 ;address = 0
clrf data16_2
call data16
usec10
movlw b'10100000' ;record from set address
movwf data_out
call data8
set_ss
bra lp567
recatxx prtstr2 recordxx ;print "Record at xx"
clr_ss
movlw b'10110000' ;record from current address
movwf data_out
call data8
set_ss
bra lp567
part 2 3021 bytes content-type:image/gif; (decode)

part 3 35 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)
2008\01\26@060046
by
Jinx
Been having quite the discussion with ISD engineers over the
past few days and have resolved some issues
Firstly, I have to congratulate them on being very receptive to
my queries. Their response has been excellent (a pity I needed
to raise the points in the first place but .....). A certain company
dear to our hearts would not say
> Hi Jinx, Thanks a lot for your precious comments
Rather "Oh sure. Yeah, we'll get right on that". Not
> I found another revision of datasheet. Do you think this one
> is better than the one you have? If yes, I will proceed the
> modification on this revision
The isd.com pdf for the ISD5008 is dated August 2000. The
person I've been corresponding with has discovered another
datasheet (as above) dated March 2004. As he says
"There is no link for this datasheet yet. I just found it in one of
our design engineers' folder. I will discuss with our design engineers,
modify the datasheet, send it to you, and put it to our website"
[Jinx] The 5008 datasheet says that an interrupt will be seen on INT
when a STOP command is sent. I don't see these interrupts. The
phrases are being recorded and INT goes low at an EOM, but not
at STOP
[Eden] According to our design engineer, STOP does not cause
the INT to go low. May I know where in datasheet you see the
description so we can correct it ?
The new pdf he found doesn't mention STOP sending INT low,
so that was fixed in that (as yet unreleased) revision
[Jinx] Does the 5008 have a SETMC command like the 4003 does ?
I have over 20 phrases in a menu system and will need to go backwards
as well as forwards depending on responses. It seems to me the only
way is a PLAY @ 0 command followed immediately by a STOP and
then Cue forwards. I wonder why the 5008 does not have a SETMC
in the datasheet
[Eden] Yes the 5008 does not have a SETMC command. I have to
check with another design engineer about the reason we took it off. I
will respond to you later
As it turns out, the 5008 DOES have a SETMC command. I tried
the 4003 SETMC, adjusted to 24-bit for the 5008, and it works. It's
just been left out of both 5008 manuals for apparently no good reason
rst_ptr call power_up
call ms60 ;Tpud * 2, 60ms delay (8kHz sampling)
clr_ss
clrf data16_1 ;address = 0
clrf data16_2
call data16 ;send address
usec10
movlw b'11101000' ;SETMC
movwf data_out
call data8 ;send command
set_ss
The 4003 description of SETMC says
"Initiates Message Cueing from address <A0-A10>"
The SETMC command I've tried for the 5008 seems to do just
that, if I'm interpreting it correctly. It resets the address to 0 and
then performs a Cue to the start of message 2. (I've not used the
4003 so I can't say for sure what SETMC does on it). Play @ 0
is available for message 1 of course
A couple of things I've asked them to make clearer and more
consistent with the 4003 manual
[Jinx] The 4003 datasheet says that a second POWERUP command
is needed, but the 5008 datasheet doesn't mention this. [snip] Can
you clarify that please ?
[Eden] According to our design engineer, a second POWERUP is
needed
[Jinx] The 5008 manual does not mention pull-up resistors for RAC
and INT and they aren't in Fig21. Pull-up resistors for RAC and INT
are mentioned in the 4003 manual descriptions, and also shown in Fig9.
Those not familiar with pull-ups might not be aware of their purpose
[Eden] Thank you for that suggestion, it would help
More... (looser matching)
- Last day of these posts
- In 2008
, 2009 only
- Today
- New search...