Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

An audio example for dsPIC30f6014

Status
Not open for further replies.

BIxi

Newbie level 4
Joined
Jan 28, 2005
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
48
Hi guys!!!
I am working with the development board of the dsPIC30f6014.
I have the information about the registers, but I don´t know how can I know the meaning of this instructions:

while (!DCISTATbits.TMPTY); /* wait until TXBUF0 and TXBUF1 have been
moved to their shadow registers for
transmission */
TXBUF0 = 0x7FFF;
TXBUF1 = 0x2300;


Someone told me that
TXBUF0 = 0x7FFF; means that; it tells to the codec to be ready because the information is going to receive is not an audio information...
The information is going to receive is an initialization information...

(How can the programer know that giving TXBUF0 0x7FFF value means this information???)


TXBUF1 = 0x2300; How can I know what is the meaning of this numbers for the codec???


Someone can help me.........
 

BIxi said:
I am working with the development board of the dsPIC30f6014.
I have the information about the registers, but I don´t know how can I know the meaning of this instructions:

TXBUF1 = 0x2300; How can I know what is the meaning of this numbers for the codec???

What development board are you using? What is the CODEC are you using? :)

If you are using dsPICDEM board, Si3000 datasheet (CODEC onboard) is included in the CD. You will find "meaning of this numbers" there ;)
 

What development board are you using? What is the CODEC are you using?
I am using dsPICDEM board.
And the codec is si3000.
But in the datasheet I have it doesn´t say the meaning of this registers...

si3000.pdf this is the datasheet I am using.

Can someone tell me where can I find a more complet datasheet?

regards
 

There is no "more complet datasheet", you just need to look between the lines :)

So... from the actual datasheet:

Digital information is transferred between the DSP and the Si3000 in the form of 16-bit Primary Frames and 16-bit Secondary Frames. There are separate pins for receive (SDO) and transmit (SDI) functions, providing simultaneous receive/transmit operation within each frame.
Primary Frames are used for digital audio data samples. Primary Frames occur at the frame rate and are always present. Secondary Frames are used for accessing internal Si3000 registers. Secondary Frames are not always present and are requested on-demand. When Secondary Frames are present, they occur mid-point between Primary Frames. Hence, no Primary Frames are dropped

You must realize that when you send audio data with bit0=1, it tells si3000 that the next word you send is the secondary frame data. In your example:

TXBUF0 = 0x7FFF;
TXBUF1 = 0x2300;

0x7FFF has bit0=1, means 0x2300 is a "control word"


Pay attention to this page from datasheet:

During a read cycle, the R/W bit is high and the 5-bit address field contains the address of the register to be read. The contents of the 8-bit control register are placed on the SDO signal. During a write cycle, the R/W bit is low and the 5-bit address field contains the address of the register to be written. The 8-bit data to be written immediately follows the address on SDI. Only one register can be read or written during each secondary frame. See "Control Registers‚" on page 20 for the register addresses and functions.

As always... see datasheet for more details about registers. :)


HTH,
Admir.
 

thank you admir
but

what´s the meaning of 0x2300 is a "control word" ?

why this control word and not other?
 

You are new to datasheets, eh? ;)

If you wish to write to CODEC, then you need to write 16 bits this way (see attached picture from datasheet):

D0..7: data to write
D8..D12: address of the CODEC register to write
D13: read/-write bit (=0 for write operation)
D14..D15: reserved (=0)

So, for example if I want to write value 0x18 to register 1, I send:
(in binary) 0000 0001 0001 1000 or in HEX: 0x0118.

OK, now, what is 0x0118 and how do I know what it does? After consulting datasheet you will find that it sets bits SPD, LPD, and reset bits HPD, MPD, CPD. Description for SPD tells me that it will power line driver, and speaker driver in CODEC.

what´s the meaning of 0x2300

It reads register 3.


Bottom line: you have to construct the "control word" from bits described in datasheet.


Regards,
Admir.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top