shivs
Joined: 15 Mar 2007 Posts: 1
|
VS1011e - Can R/W SCI reg but SDI does not work [SPI] |
Posted: Thu Mar 15, 2007 12:18 am |
|
|
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? |
|