Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

ISD1700 in SPI Mode with ATMega8

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
Ajaxelectronic

Bascom Member



Joined: 22 Nov 2009
Posts: 171
Location: Iran

iran.gif
PostPosted: Thu May 01, 2014 11:40 am    Post subject: ISD1700 in SPI Mode with ATMega8 Reply with quote

Hi

i put 2 code for driving ISD1700 Voice Recorder ICs. one for REC, STOP, PLAY and ERASE commands and another for SET_REC, STOP,SET_ PLAY and SET_ERASE commands. the SPI mode is hard to run for many people almost! with these code you can run ISD1700 series in SPI mode very easy.

First code : REC, STOP, PLAY and ERASE commands

in this mode with REC command ISD began record voice to get STOP command from SPI, then it make an EOM bit on the current position in memory. when we send PLAY command ISD play voice from start location to EOM address. also ERASE will erase memory from start location to EOM location.


Second code : SET_REC, STOP,SET_ PLAY and SET_ERASE commands
in this mode we can define our favorite address for start and end for recording, playing and erasing too.
all things in this mode is ok, but the LED sometimes don't blink! i don't know! also PLAY statement run 2 time for me! i don't have any idea for it!

_________________
www.mrkelectronic.blogfa.com

Best Regards
Back to top
View user's profile Visit poster's website Yahoo Messenger
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6197
Location: Holland

blank.gif
PostPosted: Fri May 02, 2014 9:06 pm    Post subject: Reply with quote

thank you for sharing. how is the sound quality? i remember the first ones were nice but only for some toys, but that is ages ago Smile
_________________
Mark
Back to top
View user's profile Visit poster's website
Ajaxelectronic

Bascom Member



Joined: 22 Nov 2009
Posts: 171
Location: Iran

iran.gif
PostPosted: Fri May 02, 2014 9:16 pm    Post subject: Reply with quote

the sound quality is good, very more than toys applications! ISD has an Audio/AUX output also. this is better for high quality project, switch between Audio and AUX mode is possible with set and reset AUD/AUX bit in the APC2 register. i put "write ACP2" subroutine below (there is in the attached file above too). and the other hand we can play voice on the phone line with a good quality without any noise!


Code:


'--------------------------------------------------------------------------
'Write APC2
Sub Wr_apc2

  ' ---------------------------------------------------------------------------------------------
  '| APC Byte1:|   Bit7  |  Bit6  |    Bit5    |    Bit4   |      Bit3     |  Bit2 | Bit1 | Bit0 |
  '| APC Byte1:| AUD/AUX | SPI_FT | SE_Editing | Mix_Input | Monitor_Input |  VOL2 | VOL1 | VOL0 |
  ' ---------------------------------------------------------------------------------------------

  ' ---------------------------------------------------------------------------------------
  '| APC Byte2:| (Bit7~Bit4 are Ignore) |    Bit3    |  Bit2  |      Bit1        |  Bit0   |
  '| APC Byte2:| (Bit7~Bit4 are Ignore) | EOM_Enable | vAlert | PU_Analog_Output | PWM_SPK |
  ' ---------------------------------------------------------------------------------------

  If Rdy = 0 Then Rd_status

  N = 3
  D(1) = &H65 : D(2) = &HC0 : D(3) = &H0C
  Spi_txrx

  Waitms 200

  If D(1).0 = 0 Then                                        'Check CMD-Err
    Waitms 200
    Print "Write APC2..."
    Rdy = 0
    Clr_int

   Else
    Waitms 200
    Print "occur an err in Write APC2, Retry..."
    Print
    'Clr_int
    'Wr_apc2

  End If

  Print "APC Byte1: AUD/AUX SPI_FT SE_Editing Mix_Input Monitor_Input VOL2 VOL1 VOL0"
  Print "APC Byte1:    " ; D(3).7 ; "      " ; D(3).6 ; "        " ; D(3).5 ; "         " ; D(3).4 ; "            " ; D(3).3 ; "         " ; D(3).2 ; "    " ; D(3).1 ; "    " ; D(3).0
  Print
  Print "APC Byte2: EOM_Enable vAlert PU_Analog_Output PWM_SPK"
  Print "APC Byte2:      " ; D(4).3 ; "       " ; D(4).2 ; "           " ; D(4).1 ; "            " ; D(4).0
  Print

End Sub
 

_________________
www.mrkelectronic.blogfa.com

Best Regards
Back to top
View user's profile Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum