This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5515 / AIC3204 configuration with loopback in input

Hi, i'm trying to acquire signals from AIC3204 and processing them with C5515 in C5515 eZdsp SoC.

I have this issue.

it seems my input generated with a function generator, loops back into the codec DAC output.

This is my codec configuration (192Khz mono)

;****************************************************************************************
; Configure AIC3204
;****************************************************************************************
	 ; Point to page 0
        AC1 = #0
        AR1 = #0x0
        call i2c_WriteData8

        ;reset codec
        AC1 = #1
        AR1 = #0x1
        call i2c_WriteData8

	    ; Point to page 1
        AC1 = #0
        AR1 = #0x1
        call i2c_WriteData8

        ;Disable crude AVDD generation from DVDD
        AC1 = #1
        AR1 = #0x08
        call i2c_WriteData8

        ;Enable Analog Blocks and LDO
        AC1 = #2
        AR1 = #0x01
        call i2c_WriteData8

		;***********************************************************************
        ;* PLL and Clocks config and Power Up
		;***********************************************************************
	    ; Point to page 0
        AC1 = #0
        AR1 = #0x0
        call i2c_WriteData8

        ;AIC is master running off of 12 MHz crystal
        ;BCLK and WCLK is set as op to AIC3204(Master)
        AC1 = #27
        AR1 = #0x0D
        call i2c_WriteData8

        ;PLL setting: PLLCLK <- MCLK and CODEC_CLKIN <-PLL CLK
        AC1 = #4
        AR1 = #0x03
        call i2c_WriteData8

        ;Aggiunto
        AC1 = #5
        AR1 = #0x91
        call i2c_WriteData8

        ;PLL setting: J=8
        AC1 = #6
        AR1 = #0x08
        call i2c_WriteData8

        ;PLL setting: HI_BYTE(D) for D=0x0780 (or 1920 decimal)
        AC1 = #7
        AR1 = #0x07
        call i2c_WriteData8

        ;PLL setting: LO_BYTE(D) for D=0x0780
        AC1 = #8
        AR1 = #0x80
        call i2c_WriteData8

        ;Aggiunto
        AC1 = #11
        AR1 = #0x82
        call i2c_WriteData8

        ;Aggiunto
        AC1 = #12
        AR1 = #0x84
        call i2c_WriteData8

        ;Aggiunto
        AC1 = #13
        AR1 = #0x0
        call i2c_WriteData8

        ;Aggiunto
        AC1 = #14
        AR1 = #64
        call i2c_WriteData8

        ;
		AC1 = #30
		AR1 = #0x87
		call i2c_WriteData8

		;AOSR for AOSR = 128 decimal or 0x0080 for decimation filters 1 to 6
	    AC1 = #20
	    ;AR1 = #0x80
	    AR1 = #64
	    call i2c_WriteData8

		;Power up NADC and set NADC value to 8
	    AC1 = #18
	    AR1 = #0x82
	    call i2c_WriteData8

	    ;Power up MADC and set MADC value to 2
	    AC1 = #19
	    AR1 = #0x84
	    call i2c_WriteData8


		;***********************************************************************
        ;* DAC ROUTING and Power Up
		;***********************************************************************
        ;Select page 1
        AC1 = #0
        AR1 = #0x01
        call i2c_WriteData8

        ;LDAC AFIR routed to HPL
        AC1 = #0xC
        AR1 = #0x0A
        call i2c_WriteData8

        ;RDAC AFIR routed to HPR
        AC1 = #0xD
        ;AR1 = 0x08
        AR1 = #0x00
        call i2c_WriteData8

        ;Select page 0
        AC1 = #0
        AR1 = #0x00
        call i2c_WriteData8

        ;Left vol=right vol
        AC1 = #64
        AR1 = #0x06
        call i2c_WriteData8

        ;Left DAC gain to 0dB VOL; Right tracks Left
        AC1 = #65
        AR1 = #0x00
        call i2c_WriteData8

        ;Power up left,right data paths and set channel
        AC1 = #63
        ;AR1 = #0x92
        AR1 = #0xB2
        call i2c_WriteData8

        ;Select page 1
        AC1 = #0
        AR1 = #0x01
        call i2c_WriteData8

        ;Unmute HPL , 0dB gain
        AC1 = #0x10
        AR1 = #0x00
        call i2c_WriteData8

        ;Mute HPR , 0dB gain
        AC1 = #0x11
        AR1 = #0x7A ;#0x40
        call i2c_WriteData8

        ;Power up HPL
        AC1 = #9
        ;AR1 = 0x28 -- prec
        AR1 = #0x22 ; MAL Power Up
        call i2c_WriteData8

		;Select page 0
        AC1 = #0
        AR1 = #0x00
        call i2c_WriteData8

		@BRC0_L = #0x02FF || mmap()
		localrepeat {
			repeat(#0xFFFF)
			NOP_16
			NOP_16
		}

		;***********************************************************************
        ;* ADC ROUTING and Power Up
		;***********************************************************************
		;Select page 1
	    AC1 = #0
	    AR1 = #0x01
	    call i2c_WriteData8

 .if 0 ;STEREO 2 Jacks are not connected properly on board A15
		;IN3_L to LADC_P through 40 kohm
	    AC1 = #0x34
	    AR1 = #0x0C
	    call i2c_WriteData8

		;IN3_R to RADC_P through 40 kohmm
	    AC1 = #0x37
	    AR1 = #0x00;#0x0C
	    call i2c_WriteData8
 .else  ;STEREO 1 Jack
		;IN2_L to LADC_P through 40 kohm
	    AC1 = #0x34
	    AR1 = #0x30
	    call i2c_WriteData8

		;IN2_R to RADC_P through 40 kohmm
	    ;AC1 = #0x37
	    ;AR1 = #0x30
	    ;call i2c_WriteData8
 .endif

		;CM_1 (common mode) to LADC_M through 40 kohm
	    AC1 = #0x36
	    AR1 = #0x03
	    call i2c_WriteData8

		;CM_1 (common mode) to RADC_M through 40 kohm
	    ;AC1 = #0x39
	    ;AR1 = #0xC0
	    ;call i2c_WriteData8

		;MIC_PGA_L unmute
	    AC1 = #0x3B
	    AR1 = #0x5D
	    call i2c_WriteData8

		;MIC_PGA_R unmute
	    AC1 = #0x3C
	    AR1 = #0x80
	    call i2c_WriteData8

        ;Select page 0
        AC1 = #0
        AR1 = #0x00
        call i2c_WriteData8

        ;Powerup Left ADC
        AC1 = #0x51
        AR1 = #0x80
        ;AR1 = #0x8A
        call i2c_WriteData8

        ;Unmute Left ADC and mute Right ADC
        AC1 = #0x52
        ;AR1 = 0x00 -- prec
        AR1 = #0x08
        call i2c_WriteData8

        ;Dummy read
        AC1 = 9
        AR1 = 0xABAB
;       call i2c_ReadData8
 .endif

Any idea?

I there a reason why my signal is looped back?

Thanks in advance

Paolo