I noticed that there are a few settings in InitCodec() need to be modified based om TWR-Audio schematic. I did the following mods BUT the demo still doesn't work
list of modifications:
in sgtl5000.c
//fixme change the value based on VDDA = 3.3V VDDA/2 = 1.65V.
sgtl_WriteReg(CHIP_REF_CTRL, 0x01FE);
//sgtl_WriteReg(CHIP_REF_CTRL, 0x004E);
//fixme VDDA = VDDIO = 3.3V. Based on Table.32 the left LO volume (bits 12:8) and right LO volume (bits 4:0) value should be set to 0x0F
sgtl_WriteReg(CHIP_LINE_OUT_VOL, 0x0F0F);
//sgtl_WriteReg(CHIP_LINE_OUT_VOL, 0x0505);
//fixme(SM) VDDD is derived internally on TWR-AUDIO so I commented out the line below
//sgtl_WriteReg(CHIP_ANA_POWER, 0x4260);
//fixme(SM) both VDDA and VDDIO are greater than 3.1 V on TWR-AUDIO so I commented out these two lines
//sgtl_WriteReg(CHIP_CLK_TOP_CTRL, 0x0800); // Enable the internal oscillator for the charge pump (Set bit 11)
//sgtl_WriteReg(CHIP_ANA_POWER, 0x4A60); // Enable charge pump (Set bit 11)