DSPRelated.com
Forums

Re: [Fwd: about McBSP] + secondary comm. for TI codecs

Started by Jeff Brower June 15, 2002
Pegasus Byron-

> Thank you for your reply. I checked the archives
> yestoday, and indeed, I found the asm file that you
> posted. But the source code for the second
> communication is the style of hardware, not software.
> Do you have the experiences that use software method
> to send control data to codec device?

For software method to send "secondary communication values to TI codecs, the
C54xx
asm code below might be of some help. This is for initializing the AC01 codec
device
on the old-style DSK C54x board. Note that you will need to convert the TDXR,
TCR,
TCSR, TSPC, etc. registers to their McBSP equivalent locations and values. But
the
format and sequence of secondary/primary words for the codec will be similar.

Jeff Brower
DSP sw/hw engineer
Signalogic xf = 0 ; reset ac01
tcr = #10h ; stop timer
tspc = #0008h ; stop TDM serial port

ifr = #080h ; clear flag from IFR
tdxr = #0h ; send 0 as first xmit word
tcsr = #1

tspc = #00c8h ; reset and start TDM serial port

xf = 1 ; release ac01 from reset

; AIC CONFIGURATION

TDXR = #0003h ; primary - secondary comm coming
CALL WaitXRDY

A = @FS_MODE
A = A << -8 ; A value in upper half of FS_MODE
A = A | #0100h
TDXR = A ; secondary 1 - Reg A
CALL WaitXRDY

TDXR = #0003h ; primary - secondary comm coming
CALL WaitXRDY

A = @FS_MODE ; get sampling rate setting from host (or other
source)
A = A & #0FFh ; B value in low half of FS_MODE
A = A | #0200h
TDXR = A ; secondary 1 - Reg A
CALL WaitXRDY

TDXR = #0003h ; primary - secondary comm coming
CALL WaitXRDY

TDXR = #0300h ; secondary 3 - default
CALL WaitXRDY

TDXR = #0003h ; primary - secondary comm coming
CALL WaitXRDY

TDXR = #0409h ; secondary 4 - Amplifier Gain Select
; TDXR = #040dh ; secondary 4 - Amplifier Gain Select
; Monitor = squelch
; Input = 6 dB
; Output = 0 dB
CALL WaitXRDY

TDXR = #0003h ; primary - secondary comm coming
CALL WaitXRDY

; TDXR = #0505h ; secondary 5 - Analog Config
TDXR = #0501h ; secondary 5 - Analog Config (default)
; HighPass disabled
; IN
CALL WaitXRDY

TDXR = #0003h ; primary - secondary comm coming
CALL WaitXRDY

TDXR = #0600h ; secondary 6 - default
CALL WaitXRDY

TDXR = #0003h ; primary - secondary comm coming
CALL WaitXRDY

TDXR = #0700h ; secondary 7 - default
CALL WaitXRDY

TDXR = #0003h ; primary - secondary comm coming
CALL WaitXRDY

TDXR = #0801h ; secondary 8 - default
CALL WaitXRDY

TDXR = #0 ; return to neutral (operating) state
CALL WaitXRDY
A = TRCV ; clear out receive buffer

TDXR = #0
CALL WaitXRDY
A = TRCV

RETURN

; wait for xmit buffer to be emptied (output)

WaitXRDY:

A = TSPC
A = A & #0800H
IF (AEQ) GOTO WaitXRDY

RETURN

> --- Jeff Brower <> wrote:
> > Pegasus Byron-
> >
> > Please check the c54x group archives. Some time ago
> > I posted asm source to the group
> > that shows how to intialize the codec device on the
> > DSK C5402 board directly, without
> > calling CCS functions. That should give you some
> > guidance in working with the AIC10
> > part.
> >
> > Jeff Brower
> > DSP sw/hw engineer
> > Signalogic
> >
> > -------- Original Message --------
> > Subject: about McBSP
> > Date: Fri, 14 Jun 2002 00:20:07 -0700 (PDT)
> > From: byrpb werwqer <>
> > To:
> >
> > Hi, I know you are an expert about TI'54x and their
> > McBSP from the messages you posted. So, I want to
> > get
> > some help from you.
> > I'm doing work with TI'C5402. And the system I'm
> >
> > developing contains a device named tlv320aic10,
> > which
> > you must be familar with it. You know, the
> > communicaiton between 5402 and the codec is via
> > McBSP.
> > I've pull down the level of FC pin to ground when I
> > designed the board, and I wanted to uses software
> > method to finish the second communication between
> > DSP
> > and the Codec. But I found the control data can't be
> > written into the Codec. Does there exist some
> > hinders
> > or pitfalls?
> > Expecting your help.
> > Thanks a lot!