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 support@ccsinfo.com

Help me, i cant play sine test with Pic16f887 + VS1011

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



Joined: 29 Sep 2012
Posts: 8

View user's profile Send private message

Help me, i cant play sine test with Pic16f887 + VS1011
PostPosted: Sat Sep 29, 2012 7:16 am     Reply with quote

I starting test sine tone with my vs1011 breakboard, but i didn't hear anything. I dont know my hardware problem or my code.
Anyone did it work plz help me for my project.
Here is my code.
Code:

#include <16F887.h>

#device ADC=8
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

#define     XCS  PIN_A0
#define     XDCS  PIN_A2
#define     XRESET  PIN_A1
#define     DREQ  PIN_A3

void VsSineTest();

void main()
{
   setup_spi(SPI_MASTER | SPI_H_TO_L | SPI_CLK_DIV_16 );
   
  VsSineTest();
 
}

void VsSineTest(){
 output_low(XRESET);   
  delay_ms(100);   
  spi_write(0xFF);

 output_high(XCS);
 output_high(XDCS);   
 output_high(XRESET);
  delay_ms(100);         

  output_low(XCS);   
  spi_write(0x02);   
  spi_write(0x00); 
  spi_write(0x08);   
  spi_write(0x20);     
 
   output_high(XCS); 

  while (!input(DREQ));   
                       
   output_low(XDCS);     

  spi_write(0x53);   
  spi_write(0xef);   
  spi_write(0x6e);   
  spi_write(0x44);     
  spi_write(0x00);     
  spi_write(0x00);
  spi_write(0x00);
  spi_write(0x00);
 
  output_high(XDCS) ;
 
  delay_ms (500);           

 
  output_low(XDCS);
  spi_write(0x45);
  spi_write(0x78);
  spi_write(0x69);
  spi_write(0x74);
  spi_write(0x00);
  spi_write(0x00);
  spi_write(0x00);
  spi_write(0x00);
 
   output_high(XDCS) ;

  delay_ms(500);         



Thanks !
Ttelmah



Joined: 11 Mar 2010
Posts: 19394

View user's profile Send private message

PostPosted: Sat Sep 29, 2012 8:19 am     Reply with quote

Obvious comment is, where are you setting the volume?.
The clock rate (if you are not using the standard setting), and volume, must be set after reset. Quote from data sheet:

"After a hardware reset (or at power-up), the user should set such basic software registers as SCI_VOL for volume (and SCI_CLOCKF if the input
clock is anything else than 24.576 MHz) before starting decoding."

Best Wishes
tidushuu



Joined: 29 Sep 2012
Posts: 8

View user's profile Send private message

Work
PostPosted: Sat Sep 29, 2012 8:47 am     Reply with quote

Wow thanks.
I finally made it work, reason as your comment, I didn't set volume on my code.
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