|
|
View previous topic :: View next topic |
Author |
Message |
tidushuu
Joined: 29 Sep 2012 Posts: 8
|
Help me, i cant play sine test with Pic16f887 + VS1011 |
Posted: Sat Sep 29, 2012 7:16 am |
|
|
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: 19536
|
|
Posted: Sat Sep 29, 2012 8:19 am |
|
|
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
|
Work |
Posted: Sat Sep 29, 2012 8:47 am |
|
|
Wow thanks.
I finally made it work, reason as your comment, I didn't set volume on my code. |
|
|
|
|
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
|