xCORE-200 how to use cs2100 only

XCore Project reviews, ideas, videos and proposals.
hamtam
Junior Member
Posts: 6
Joined: Wed Jun 28, 2017 7:37 am

xCORE-200 how to use cs2100 only

Postby hamtam » Wed Jun 28, 2017 3:40 pm

I am using the XK-AUDIO-216-MC-AB Board and I am wondering how to switch to the Cirrus Logic CS2100 PLL Chip which is also on the board. I am using the "app_usb_aud_xk_216_mc".
Four our own design we want to use the CS2100 IC together with a 24MHz reverence clock and not the a Phase Logic PL611-01.
User avatar
infiniteimprobability
XCore Expert
Posts: 874
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Thu Jun 29, 2017 11:09 am

Normally switching on SPDIF_RX does this. But in audio_hw.xc (which is where the user callbacks for setting up hardware are) you can see:

Code: Select all

#if defined(SPDIF_RX) || defined(ADAT_RX)
#define USE_FRACTIONAL_N 1
#endif


Try forcing USE_FRACTIONAL_N to 1. I think this should do it.

You will probably have to enable the PLL ref input pin too in main.xc:

Code: Select all

#ifdef SPDIF_RX
on tile[XUD_TILE] : buffered in port:4 p_spdif_rx           = PORT_SPDIF_IN;
#endif
hamtam
Junior Member
Posts: 6
Joined: Wed Jun 28, 2017 7:37 am

Postby hamtam » Fri Jun 30, 2017 9:56 am

Thank you for your help. I tried defining it in the custimdefines.h

Code: Select all

/* CONET set define  */
#define USE_FRACTIONAL_N    1
#define SPDIF_TX            1
/* CONET END */


This leads to some failures during flashing.

Code: Select all

Description   Resource   Path   Location   Type
'SPDIF_TX' macro redefined   customdefines.h   /app_usb_aud_xk_216_mc/src/core   line 23   C/C++ Problem
Invalid project path: Include path not found (lib_src).   AN00231_ASRC_SPDIF_TO_DAC      pathentry   Path Entry Problem
unused parameter `sampRes_DAC' [-Wunused-parameter]   audiohw.xc   /app_usb_aud_xk_216_mc/src/extensions   line 156   C/C++ Problem
unused parameter `sampRes_ADC' [-Wunused-parameter]   audiohw.xc   /app_usb_aud_xk_216_mc/src/extensions   line 156   C/C++ Problem
unused parameter `c_codec' [-Wunused-parameter]   audiohw.xc   /app_usb_aud_xk_216_mc/src/extensions   line 111   C/C++ Problem
unused parameter `c_codec' [-Wunused-parameter]   audiohw.xc   /app_usb_aud_xk_216_mc/src/extensions   line 155   C/C++ Problem
use of undeclared identifer `PORT_PLL_REF'   audiohw.xc   /app_usb_aud_xk_216_mc/src/extensions   line 98   C/C++ Problem
previous definition is here   app_usb_aud_xk_216_mc      line 14   C/C++ Problem
initializer element is not constant   audiohw.xc   /app_usb_aud_xk_216_mc/src/extensions   line 98   C/C++ Problem
previous definition is here   app_usb_aud_xk_216_mc      line 14   C/C++ Problem
Invalid project path: Include path not found (lib_usb/src/lowlevel).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_spdif/src).   AN00231_ASRC_SPDIF_TO_DAC      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_src/src).   AN00231_ASRC_SPDIF_TO_DAC      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_src/src/FilterData).   AN00231_ASRC_SPDIF_TO_DAC      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_src/api).   AN00231_ASRC_SPDIF_TO_DAC      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_spdif).   AN00231_ASRC_SPDIF_TO_DAC      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_spdif/api).   AN00231_ASRC_SPDIF_TO_DAC      pathentry   Path Entry Problem
*** Missing build modules. Cannot continue.  Stop.   AN00231_ASRC_SPDIF_TO_DAC      line 646, external location: /home/mthomas/daten/Dokumente/xmos/xTIMEcomposer/Community_14.3.0/build/xcommon/module_xcommon/build/Makefile.common1   C/C++ Problem
Invalid project path: Include path not found (lib_usb/src/endpoint0).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb/src/experimental).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb/api).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb/src/experimental/endpoint0).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb/xudlib).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb/src/experimental/dfu).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb/src).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb/xudlib/glx_support).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
Invalid project path: Include path not found (lib_usb/xudlib/included).   AN00182_hid_extended_explorer      pathentry   Path Entry Problem
*** Missing build modules. Cannot continue.  Stop.   AN00182_hid_extended_explorer      line 646, external location: /home/mthomas/daten/Dokumente/xmos/xTIMEcomposer/Community_14.3.0/build/xcommon/module_xcommon/build/Makefile.common1   C/C++ Problem
User avatar
infiniteimprobability
XCore Expert
Posts: 874
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Mon Jul 03, 2017 2:46 pm

USE_FRACTIONAL_N is not a global define and isn't checked for in audio_hw.xc before being set so customdefines isn't the right place to set it. What I meant was change it locally in audio_hw.xc:

Code: Select all

//#if defined(SPDIF_RX) || defined(ADAT_RX)
#define USE_FRACTIONAL_N 1
//#endif


You may want to tidy this up and add a "FORCE_USE_CS2100" define or something to be tidier, but the above works (I just tested it).


Not sure about your build errors/warnings. Looks unrelated. Maybe try build clean.
hamtam
Junior Member
Posts: 6
Joined: Wed Jun 28, 2017 7:37 am

Postby hamtam » Wed Jul 05, 2017 8:57 am

OK I set the Variable in the makefile. That should set the variable globally. I think I also tried your approach. Currently I check if the CS2100 is setup right via I2C maybe here is a problem.

Code: Select all

# Audio Class 2, Input (8), Output (8), No MIDI, No SPDIF i/o, No ADAT i/o, TDM mode
XCC_FLAGS_2i8o8xxxxx_tdm8  = $(BUILD_FLAGS) -DI2S_CHANS_DAC=8 -DI2S_CHANS_ADC=8 -DNUM_USB_CHAN_OUT=8 -DNUM_USB_CHAN_IN=8 \
                        -DMIDI=0 -DSPDIF_TX=1 -DUSE_FRACTIONAL_N0=1 -DSPDIF_RX=0 -DADAT_TX=0 -DADAT_RX=0 -DDSD_CHANS_DAC=0 \
                        -DI2S_MODE_TDM=1 -DMAX_FREQ=96000
hamtam
Junior Member
Posts: 6
Joined: Wed Jun 28, 2017 7:37 am

Postby hamtam » Wed Jul 05, 2017 9:25 am

I tried your approach just. The logic Level of U12 Pin5 which is PLL_SELECT remains on 0. But if the CS2100 is the clock source it should be 1 (3,3V) to switch the CLK_OUT signal to the Analog Converter chips. I also can only see the clock signal from the PL611 but no signal from the cirrus logic chip.
User avatar
infiniteimprobability
XCore Expert
Posts: 874
Joined: Thu May 27, 2010 10:08 am
Contact:

Postby infiniteimprobability » Mon Jul 10, 2017 10:29 am

HI, I'm not sure what to suggest other than try a fresh version of the ref design and just literally make the change to audiohw.xc that I suggested above.

I have done that and get:

1KHz ref signal on U10 pin 5
22.5792MHz or 24.576MHz on U10 pin 3 (depending on sr selected)
High on U12 pin 6 (PLL select)
U10's clock coming out on U12 pin 4

Which is what you want?

Screen Shot 2017-07-10 at 10.36.45.png
(63.12 KiB) Not downloaded yet
Screen Shot 2017-07-10 at 10.36.45.png
(63.12 KiB) Not downloaded yet
hamtam
Junior Member
Posts: 6
Joined: Wed Jun 28, 2017 7:37 am

Postby hamtam » Tue Jul 11, 2017 2:02 pm

I had to wipe my eclipse settings in the .xmos folder delete my workspace together with the metadata and reimported the demo Software again. After that I managed to compile it as you suggested. The Cirrus Chip is usd now.
I set in "-DUSE_FRACTIONAL_N0=1" in the make file which worked properly.
Now I have to adapt the Software for our own sound card which has the CS2100 chip. If I just flash the software for the dev board, the CS2100 is not working.
Thank you very much for you help I probably will come up with more questions.

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 12 guests