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

ISD17240

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







ISD17240
PostPosted: Tue Mar 02, 2010 3:21 am     Reply with quote

hello everybody ;-)

I searched in different forums for using an isd17240 with an 18f4550 via spi, but I haven't found useful stuff.

I wrote a code but it doesn't work.
Code:

#include <18F4550.h>            
#use delay (clock=20000000)   
#fuses HS,NOWDT, NOPROTECT, NOLVP   

#use spi(Master, Mode=2, DI=pin_B0, DO=PIN_C7, CLK=PIN_B1, BITS=8, LSB_FIRST)

#define SS pin_a5
#define SPI_MODE_2 (SPI_H_TO_L)

void pu(){
spi_write(0x00);
spi_write(0x01);
}

void play(){
spi_write(0x00);
spi_write(0x40);
}

void rec(){
spi_write(0x00);
spi_write(0x41);
}

void clr_int(){
spi_write(0x04);
spi_write(0x00);
}

void stop(){
spi_write(0x00);
spi_write(0x02);
}

void main()
{
set_tris_a(0b11011111);
set_tris_b(0b11111101);
set_tris_c(0b01111111);
setup_spi(spi_master | SPI_MODE_2 | spi_clk_div_64|SPI_SS_DISABLED);
delay_ms(100);

output_high(pin_a5);

//init();
delay_ms(100);
   
output_low(pin_a5);
delay_ms(50);
pu();
delay_ms(10);
output_high(pin_a5);

delay_ms(50);

output_low(pin_a5);
delay_ms(50);
rec();
delay_ms(10);
output_high(pin_a5);

delay_ms(3000);

output_low(pin_a5);
delay_ms(50);
stop();
delay_ms(50);
output_high(pin_a5);

delay_ms(10);

output_low(pin_a5);
delay_ms(50);
stop();
delay_ms(50);
output_high(pin_a5);


while(true){

   }      

}

I disabled SS because I use pin_a5.
In stand alone mode the ISD17240 works.

This program should record a sample for 3 seconds and then replay it.

And sry 4 my bad english ^^.

I hope you can help me :-( ...

jb
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