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

VS1011e - Can R/W SCI reg but SDI does not work [SPI]

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



Joined: 15 Mar 2007
Posts: 1

View user's profile Send private message

VS1011e - Can R/W SCI reg but SDI does not work [SPI]
PostPosted: Thu Mar 15, 2007 12:18 am     Reply with quote

Well Ive been searching these forums for a while and Ive tried a couple things but no success.

Heres my setup.
I'm using a VS1011e interfaced to a PIC18LF452. Im using the VS1011e in the SDINEW, SDISHARE and TESTS (set SCI_MODE to 0x0C20). Im using a 24.576MHZ crystal and my hardware setup is almost exact to that in the vs1011e datasheet (except XDCS is pulled high with resistor). I have a 100uF (electrolytic) on the output of the left channel with a speaker connected to the cap(-) to GND. I have successfully written and read various registers with no problem. Also as in vs10xxan.pdf I have checked the voltage across Rcap to be 1.2V (should be around 1.3V)
But when I try to run the Sine tests or Memory test, there is no response.
Code:
void vs1011_sinetest(){

setup_spi(SPI_MASTER | SPI_L_TO_H | SPI_CLK_DIV_64); //   20Mhz/64 = lowest possible speed available from PIC

int8 data[32];
int loop=0;

vs1011_hw_reset();                                      // toggle XRESET pin with 10ms delay in between
vs1011_write_cmd(MODE_REG,0x0C,0x20);  //SDINEW, SDISHARE and TESTS
vs1011_write_cmd(VOL_REG,0x00,0x00);     //set volume to max

output_high(VS1011_XCS);                           //enable SDI bus

              data[0]=0x53;
              data[1]=0xEF;
              data[2]=0x6E;
              data[3]=0x44;
              data[4]=0;
              data[5]=0;
              data[6]=0;
              data[7]=0;
              while(!input(VS1011_DREQ)) printf("Dreq Busy\r\n");

         for (loop=0;loop<8;loop++){
                 spi_write(data[loop]);
                 printf("0x%x ",data[loop]);
              }
         while(1);                //should have a 1Khz sine wave constant output but does not work
}


I do have this circuit bread boarded but I cant see why that would matter because SCI works just fine.
There no should be no difference in the SPI protocol between SCI and SDI buses except setting the XCS to high right? (high for SDI low for SCI)

Any suggestions hardware or software wise?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Mar 15, 2007 12:37 am     Reply with quote

Someone has posted sample CCS code here:
http://www.myplace.nu/mp3/yabbse/index.php?PHPSESSID=c2b2067844a4dfc4ccb2a9ab02e9cdaa&topic=3221.msg14108#msg14108

You have to read all the posts, because some of them contain corrections
to errors in the posted 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