CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

record problem on ISD4003

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
triple_x



Joined: 01 Dec 2005
Posts: 10

View user's profile Send private message

record problem on ISD4003
PostPosted: Tue Dec 20, 2005 9:07 pm     Reply with quote

hi all,
I am using ISD4003.C driver provided by CCS. I want to know if we can erase old voice msg and store new voice msg at the same location, for example location 0. In my case, when I called record_message(0) for the second time, the device won't record, it will play the previous msg instead.. any advice. 10q.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 21, 2005 5:18 pm     Reply with quote

You need to post a short, but complete program that demonstrates
the problem. Make it short.
triple_x



Joined: 01 Dec 2005
Posts: 10

View user's profile Send private message

PostPosted: Wed Dec 21, 2005 8:25 pm     Reply with quote

this is "isd4003_custom2.c" and some changes has been made on connections
Code:

#ifndef ISD4003_SELECT
/*
#define ISD4003_RAC     PIN_C1
#define ISD4003_SELECT  PIN_C2
#define ISD4003_CLK     PIN_C3
#define ISD4003_MISO    PIN_C4
#define ISD4003_MOSI    PIN_C5
*/
#define ISD4003_SELECT  PIN_D7
#define ISD4003_CLK     PIN_D3
#define ISD4003_MISO    PIN_D5
#define ISD4003_MOSI    PIN_D6
#endif


and this is the main code:
Code:

#include <16F77.h>
#fuses hs, nowdt, noput, noprotect, nobrownout

#use delay(clock=9830400)

#include "isd4003_custom2.c"

#define rs232_rcv PIN_A1
#define rs232_xmit PIN_A0

#use rs232(baud=9600, xmit=rs232_xmit, rcv=rs232_rcv, stream=com1)

// pushbutton swith to select action, active high
#define sw1 (input(PIN_A2))
#define sw2 (input(PIN_A3))
#define sw3 (input(PIN_A4))

void main() {
   long voice_address=0;
   long last_address=0;

   fprintf(com1, "ISD4003 test.\r\n");

   init_isd();
   stop_message();

   while(1) {
      if(sw1) { // record
         fprintf(com1, "Record at address=%ld\r\n", voice_address);
         record_message(voice_address);
      }
      
      if(sw2) { // stop   
         last_address = stop_message()+1;
         fprintf(com1, "Stop. Last address=%ld\r\n", last_address);
      }
      
      if(sw3) { // play
         fprintf(com1, "Play voice msg\r\n");
         play_message(0);
      }
   }
}


If I want to record other msg at location 0 i.e by pressing switch 1, the device will play at that address instead of waiting for voice to be recorded....any advice? 10q
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 21, 2005 11:11 pm     Reply with quote

Can you give the exact sequence of buttons that you press, when
this problem occurs ?

I don't really like the switch code, because:
1. It has no debouncing.
2. It uses high true switches (Do you have a pull-down resistors on them ?)
3. There's no state machine, so you can easily press switches in
the wrong sequence, and violate the spec. ie., You ought to
have a mode byte that tells you what mode you're in, and
if say, you're in record mode, the only allowable thing you
could do would be to press the STOP button.

Also, the code doesn't strictly follow the isd4003 data sheet.
The data sheet says there must be a delay after the stop command
is issued. The CCS program, EX_VOICE.C, uses 200 ms. Now
maybe there's an inherent delay between pressing the STOP button
and pressing REC again, but it's not certain. You could violate the spec.
triple_x



Joined: 01 Dec 2005
Posts: 10

View user's profile Send private message

PostPosted: Thu Dec 22, 2005 7:08 pm     Reply with quote

This is the sequence, as what I have done:

1. sw1 pressed (RECORD at location 0)
2. Finish recording..sw2 pressed (STOP)
3. sw3 pressed (PLAY)
4. Finish playing.. sw2 pressed (STOP)
5. Action is repeated from 1

I do the action manually just to see how the voice chip will behave.

I use 10k pull down resistor on each of input pins. Debouce also added

Code:


while(1) {
      if(sw1) { // record
         fprintf(com1, "Record at address=%ld\r\n", voice_address);
         record_message(voice_address);
         delay_ms(250);
      }
     
      if(sw2) { // stop   
         last_address = stop_message()+1;
         fprintf(com1, "Stop. Last address=%ld\r\n", last_address);
         delay_ms(250);
      }
     
      if(sw3) { // play
         fprintf(com1, "Play voice msg\r\n");
         play_message(0);
         delay_ms(250);
      }



Maybe I'll try to add some delays after stop command, and will post the result.
triple_x



Joined: 01 Dec 2005
Posts: 10

View user's profile Send private message

PostPosted: Fri Dec 23, 2005 12:24 am     Reply with quote

still stuck at recording point.. does anyone has an idea how to solve this issue..PCM, any more advice/tips?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
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


Powered by phpBB © 2001, 2005 phpBB Group