Codec alternatives?

sebotron
Posts: 44
Joined: Thu Jul 09, 2020 6:57 pm

Re: Codec alternatives?

Post by sebotron »

PhilHaw wrote: Thu Apr 28, 2022 5:01 am I hope that will get you going now buddy! Let us know how things go.

Phil.
Will do! Looking back at my schematics I see that I had very little understanding of the codec and was very confused haha

The thought of having to hand solder that qfn one more time though.. *shudders*
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Re: Codec alternatives?

Post by sebxx4 »

I'm trying with CS4220 codec. It basicly works, but overflow led is lighting all the time. Dont blinks, just contants light.
stanleyfx
Posts: 42
Joined: Fri Jan 27, 2017 2:19 pm

Re: Codec alternatives?

Post by stanleyfx »

The CS4220 is a nice codec but I'm sure it is discontinued from the Cirrus logic range although still available as a a CoolAudio chip as the V4220. It has differential inputs and is essentially a 5v codec. You can still run your op-amp analogue supply at 9v with a little consideration to the codec vref.
Mick (Blue Nebula Design team)
DisasterArea
Posts: 26
Joined: Sat Jul 25, 2020 7:07 pm

Re: Codec alternatives?

Post by DisasterArea »

The V4220 is out of stock everywhere for the time being, Coolaudio / MusicTribe / Behringer are using all of them for their internal production.

The '4220 (either version) runs the analogue side on 5V as noted earlier, and it has differential inputs. You can run it single-ended without issues but be aware that if you're not direct-coupling your audio in you'll need a very large coupling cap (10uF) due to the low-ish input impedance of the part. Not sure what the overflow light is about but my guess is you have some DC bias happening that's forcing all the values into the overflow range.

Post your schematic and I'll be happy to have a look, I use the '4220 in my own designs so I might have some insights.
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Re: Codec alternatives?

Post by sebxx4 »

In my case this is Crystal CS4220, but it looks the same as CirrusLogic's one.

Well, at the moment I just fired it up on prototype board so I don't have schematic. I only wanted to check if will it work so it's basicly 4220 datasheet application. FXCore Fs @ 48kHz, all codec's inputs pulled directly to GND, outputs directly to oscilloscope, VD and VA to +5V, VL to +3,3V, XTI to FXCore, DIF0/1 to GND and de-emphasis set to 48kHz.

Btw, I tried with CS4220 bacause I had one at home, but maybe you can recommend me something else? I'm looking for some cheap, easy to buy codec, without differential input.
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: Codec alternatives?

Post by Frank »

sebxx4 wrote: Sat Jul 23, 2022 8:07 am all codec's inputs pulled directly to GND
Depending on the input filter that is basically tying the inputs to max negative so clip LED will be on. Mid ref is typically Vanalog/2 or 2.5 volts in this case.
DisasterArea
Posts: 26
Joined: Sat Jul 25, 2020 7:07 pm

Re: Codec alternatives?

Post by DisasterArea »

sebxx4 wrote: Sat Jul 23, 2022 8:07 am In my case this is Crystal CS4220, but it looks the same as CirrusLogic's one.

Well, at the moment I just fired it up on prototype board so I don't have schematic. I only wanted to check if will it work so it's basicly 4220 datasheet application. FXCore Fs @ 48kHz, all codec's inputs pulled directly to GND, outputs directly to oscilloscope, VD and VA to +5V, VL to +3,3V, XTI to FXCore, DIF0/1 to GND and de-emphasis set to 48kHz.

Btw, I tried with CS4220 bacause I had one at home, but maybe you can recommend me something else? I'm looking for some cheap, easy to buy codec, without differential input.
You can use the 4220 in single-ended mode, you just need to tie the unused input (typically the -ve) to VA through a 4u7 and 100n cap. Then feed your signal into the +ve input. You can also just ignore the -ve output and use the positive.

Frank is right, if you are tying the inputs to ground you're essentially pulling them as far negative (or positive) as they can go and that looks like an overflow to the codec. Just leave them floating, they should hover around 2.5V, the same as the VA pin.
sebxx4
Posts: 26
Joined: Mon Jun 27, 2022 8:08 am

Re: Codec alternatives?

Post by sebxx4 »

Okay, so I tried to leave them floating and next to tie them to 2,5V. No change - still oflow led.

I tried to check which flag causes this error with this code:

Code: Select all

andi	flags, OUT2OFLO		; IN2OFLO / IN3OFLO / OUT2OFLO / OUT3OFLO
jz	acc32, 1
set	user0|0, acc32
multri	acc32, 0		; without any instruction here, the assembler returns error: "JZ ACC32 1" - parameter: 1 attempting to jump past end of program.
And user0 dont lights up at all :/ Looks likt it's not overflow, but is it possible?

BTW - when I tried to check OUT3OFLO, the assembler returned error "parameter: OUT3OFLO : 32768 invalid range for imm16." Compiler bug?
Frank
Posts: 159
Joined: Sun May 03, 2015 2:43 pm

Re: Codec alternatives?

Post by Frank »

sebxx4 wrote: Sat Jul 23, 2022 10:59 am Okay, so I tried to leave them floating and next to tie them to 2,5V. No change - still oflow led.
Something is causing the overflow, if you have a logic analyzer look at the data streams.
sebxx4 wrote: Sat Jul 23, 2022 10:59 am

Code: Select all

andi	flags, OUT2OFLO		; IN2OFLO / IN3OFLO / OUT2OFLO / OUT3OFLO
jz	acc32, 1
set	user0|0, acc32
multri	acc32, 0		; without any instruction here, the assembler returns error: "JZ ACC32 1" - parameter: 1 attempting to jump past end of program.
This error is correct, you can only jump to an instruction not past the end of code.
sebxx4 wrote: Sat Jul 23, 2022 10:59 am BTW - when I tried to check OUT3OFLO, the assembler returned error "parameter: OUT3OFLO : 32768 invalid range for imm16." Compiler bug?
I also get this error, must have an error in range checking on the andi instruction or error in definition of OUT3OFLO, will look into it next week. Using 0x8000 instead of OUT3OFLO works so use that as a work around for now.
DisasterArea
Posts: 26
Joined: Sat Jul 25, 2020 7:07 pm

Re: Codec alternatives?

Post by DisasterArea »

This might be a dumb question, but how is your OFLOW LED wired? You're using a separate codec, did you do a board? Or do you have a dev board? You've got the light on, it might be because the LED is wired up in an odd way. Does your setup pass audio?

On the dev board, the OFLOWLED is wired:

FXCore pin 22 -> 330 ohm resistor -> LED anode
LED cathode -> ground

I also note that you're checking the overflow values for IN2, IN3, OUT2, OUT3. Are you using two codecs? Do you have anything connected to the serial data lines for the second codec?

There's only one overflow LED and it does multiple duty for input and output on all four channels. Would be worth double-checking everything, and it always helps to draw out a schematic for anything you're building. It's really hard to check your work if you don't have something to compare it to.
Post Reply