Voice Playback CHIP SD20


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pedro Santos View Post
    Can you explain this? ...
    IF dat.0(Idx) THEN ...
    I can.

    But since Melanie's already covered the subject, I'll let her.

    Bits, Bytes Words and Arrays
    http://www.picbasic.co.uk/forum/showthread.php?t=544
    <br>
    DT

  2. #2
    Join Date
    Jul 2006
    Posts
    60


    Did you find this post helpful? Yes | No

    Default

    Thanks again Darrel

    Regards

    Pedro

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You're Welcome Pedro,

    Hope you (and everyone else) had a Happy "Boxing Day"!
    <br>
    DT

  4. #4
    Join Date
    Dec 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Thumbs up SD20 Voice Chip

    Hi Darrel

    Thanks for help of this. I finally got it working, the engineer from the manufacturer found a small bug in their chip firmware. So anyone interested in using this chip should increase the reset time and increase the time for playback also.


    See the amended code here :

    @ DEVICE XT_OSC,MCLR_OFF,LVP_OFF,WDT_OFF,PROTECT_OFF

    DEFINE LOADER_USED 1

    ' ** Setup the Resonator Frequency, in Mhz **
    Define OSC 4

    Baud con 84 ' 9600 baud rate

    ' ** Port configurations **
    TX VAR PORTB.5
    RX VAR PORTB.2
    CLK VAR PORTA.4
    DI Var PORTA.0
    RESET VAR PORTB.6
    PIEZO VAR PORTB.7

    DAT VAR WORD
    Idx VAR BYTE

    counter var byte
    volume var word

    volume = 65527

    '---------------------------------------------------------------------------

    Init:
    ANSEL = 0 'Configure all pins to digital operation since not using ADC
    CMCON = 7 ' disable comparators

    begin:
    low piezo

    dat = $FFF7
    serout2 tx,baud,["Voice Volume - 1st Data = ",bin16 dat,13,10]
    GOSUB SendDat

    dat = $4
    ' set counter to file no. 4
    counter = 4
    serout2 tx,baud,["Address 4 of voice file - 2nd Data = ",bin16 dat,13,10]
    GOSUB SendDat

    playaddr:
    dat = $fffe
    serout2 tx,baud,["Play/Pause - 3rd Data = ",bin16 dat,13,10]
    ' GOSUB SendDat
    GOSUB Playdata

    ' --------------------------------------------------------------------------
    switch:

    'if porta.2=0 then
    ' counter = counter - 1
    ' if counter<=1 then counter = 2
    ' dat = counter
    '
    ' serout2 tx,baud,["Address of voice file - 2nd Data = ",bin16 dat,13,10]
    ' GOSUB SendDat
    ' goto playaddr
    'endif

    if porta.1=0 then
    counter = counter + 1
    if counter>=7 then counter = 6
    dat = counter

    serout2 tx,baud,["Address of voice file - 2nd Data = ",bin16 dat,13,10]
    GOSUB SendDat
    goto playaddr
    endif

    ' Reduce Volume
    if porta.2=0 then
    volume = volume - 1
    if volume<=65520 then volume = 65527
    dat = volume

    serout2 tx,baud,["Address of voice volume = ",bin16 dat,13,10]
    GOSUB SendDat
    'goto playaddr
    endif

    goto switch

    STOP

    '---------------------------------------------------------------------------

    SendDAT:
    LOW RESET ; 5ms reset pulse
    PAUSE 5
    INPUT RESET
    PAUSE 300 ; 300ms before data

    For Idx = 15 to 0 STEP -1 ; loop thru the bits
    LOW CLK ; set CLK LOW
    IF dat.0(Idx) THEN
    INPUT DI ; if bit = 1 then INPUT, not HIGH
    ELSE
    LOW DI ; if bit = 0 then LOW
    ENDIF
    PAUSE 1 ; data settle time
    INPUT CLK ; clks data on rising edge
    PAUSE 1 ; data read time
    NEXT Idx ; do rest of the bits
    INPUT DI ; leave data line tri-stated
    RETURN


    ' --------------------------------------------------------------------------

    Playdata:

    LOW RESET ; 5ms reset pulse
    PAUSE 5
    INPUT RESET
    PAUSE 1250 ; 300ms before data


    For Idx = 15 to 0 STEP -1 ; loop thru the bits
    LOW CLK ; set CLK LOW
    IF dat.0(Idx) THEN
    INPUT DI ; if bit = 1 then INPUT, not HIGH
    ELSE
    LOW DI ; if bit = 0 then LOW
    ENDIF
    PAUSE 1 ; data settle time
    INPUT CLK ; clks data on rising edge
    PAUSE 1 ; data read time
    NEXT Idx ; do rest of the bits
    INPUT DI ; leave data line tri-stated
    RETURN

    ' --------------------------------------------------------------------------

    All the best; Happy NEW Year !!!

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Wow, you have to wait 1-1/4 seconds after the reset.

    That's quite a "Bug".

    Especially since the datasheet says ...
    1 second after reset , if no action to the module, the chip will be into standby status within one second if no action after reset.
    Well, at least it works!

    Happy NEW YEAR!
    DT

  6. #6
    Join Date
    Dec 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Wink SD 20 Voice Play Chip

    Thanks Darrel for your help.

    All the best and Happy New Year

    Robert Quaas

Similar Threads

  1. isd4002 problems help required please
    By Agent36 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2012, 06:57
  2. Trouble with PIC16F88 (chip hangs up)
    By nobner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th January 2009, 09:23
  3. TV Display Chip
    By zadok in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 17th April 2008, 22:17
  4. ISD4003 & 16F877 Interface
    By sayzer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th December 2006, 17:50
  5. chip selection aid
    By PICMAN in forum General
    Replies: 4
    Last Post: - 21st February 2005, 18:33

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