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

SD Card interface then play mp3 by pic

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







SD Card interface then play mp3 by pic
PostPosted: Thu Apr 20, 2006 5:01 pm     Reply with quote

I used ossiloscope measure clock signal but NO SIGNAL
Why not work?please help me.




// Configure chip and compiler
#include "18F458.h"
#fuses EC_IO,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP
#use delay(clock=16000000)
#use rs232(baud=57600, xmit=PIN_C6, rcv=PIN_C7)
#zero_ram

// Aliases for the pins used
#define F88_Servo_CS PIN_B5

#define F88_Aquire_Time 100

// Function prototypes
int readF88(void);

void main(void)
{
// Variables
int data;

// Configure pin direction, format is port X, pin 7 => pin 0; 1 is in, 0 is out
#use fast_io(A)
#use fast_io(B)
#use fast_io(C)
#use fast_io(D)
#use fast_io(E)
set_tris_a(0b00000000);
set_tris_b(0b10000000);
set_tris_c(0b10010000);
set_tris_d(0b00000000);
set_tris_e(0b00000000);

// Initially set all SPI chip selects to disable
output_high(F88_Servo_CS); // F88 CS is active low

// Setup the SPI port
setup_spi(SPI_MASTER | SPI_L_TO_H | SPI_CLK_DIV_16);

while(1)
{
data = readF88();
printf("This is the data from F88: %d\n",data);
delay_us(100);
}

return;
}

int readF88(void)
{
int F88data;

output_low(F88_Servo_CS); // select the F88 to begin aquisition of data from external source
delay_us(F88_Aquire_Time); // wait the prescribed aquisition delay
F88data = spi_read(0); // aquire the data from the F88 by sending out a clock
output_high(F88_Servo_CS); // disable the F88

return F88data;
}
tavioman



Joined: 22 Feb 2006
Posts: 65

View user's profile Send private message

PostPosted: Fri Apr 21, 2006 4:50 am     Reply with quote

Where is MP3 or SD?
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Apr 21, 2006 7:15 am     Reply with quote

Please, next time make sure your subject title matches the question.

What kind of clock circuit are you using? Is it a crystal or something else?
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