custom XMOS board not working with AN00129

New to XMOS and XCore? Get started here.
Dimitree
Junior Member
Posts: 5
Joined: Tue Sep 12, 2023 3:00 pm

custom XMOS board not working with AN00129

Post by Dimitree »

Hello everyone, this is my first project with a XMOS device,
I'm trying to build an open-source XMOS based project (https://github.com/freeDSP/freeDSP-INFINITAS).
The project is a USB audio interface, and contains a XE256-512 for the USB interfacing, along with a FPGA for digital audio routing and an optional DSP chip.
After flashing the project files into the XMOS chip, I couldn't see any new device connected to my computers (both Win and MacOS), so I tried flashing the AN00129:-USB-HID-Class(2_0_2rc1) project to test the PCB. Not even this one worked.
The simple steps I made were this:

1) using xTIMEcomposer I imported the AN00129 project along with the required libs (lib_usb, lib_gpio, lib_xassert, lib_logging).
2) built the project with the "X200" build configuration (the build was successfull with no errors)
3) flashed the XMOS with a XA-XTAG programmer, using this SPI spec file (it was provided by the project, IS25LP080D.spi-spec):

Code: Select all

 10,           /*  flash id = value returned by fl_getFlashType                  */
    256,          /*  page size in bytes                                 */
    4096,         /*  number of pages                                    */
    3,            /*  number of address bytes to send                        */
    3,            /*  divider to generate the SPI clock from the reference clock            */
    0x9F,         /*  command to read the device ID                           */
    0,            /*  number of dummy bytes returned before the ID                  */
    3,            /*  ID size in bytes                                    */
    0x9D6014,     /*  expected device ID                                 */
    0x20,         /*  command to erase all or part of a sector                     */
    4096,         /*  number of bytes erased by sector erase;  0 = entire sector            */
    0x06,         /*  command to write-enable the device                        */
    0x04,         /*  command to write-disable the device                        */
    PROT_TYPE_NONE,   /*  protection type;  PROT_TYPE_NONE = no protection            */
    {{0,0},{0,0}},    /*  description of the device protection                        */
    0x02,         /*  command to program a page                           */
    0xEB,         /*  command to read data                              */
    6,            /*  number of dummy bytes returned before the data               */
    SECTOR_LAYOUT_REGULAR,   /*  sector layout; SECTOR_LAYOUT_REGULAR=all sectors same size   */
    {4096,{0,{0}}},   /*  sector sizes                                       */
    0x05,         	  /*  command to read  the status register                        */
    0x01,         	  /*  command to write the status register                        */
    0x01,         	  /*  bit mask for the Write In Progress bit                        */

4) flashing went ok ("Site 0 has finished successfully. "), but as I said, connecting the board to the USB port, nothing happens.

this is the schematic of the XMOS portion of the board. I verified the voltages and connections, and everything looks fine.
xmosusb.png

Do you have any idea what could be wrong?
Thank you
You do not have the required permissions to view the files attached to this post.
mmar
XCore Addict
Posts: 131
Joined: Fri Jul 05, 2013 5:55 pm

Post by mmar »

Maybe you skip important point. Between 1 and 2 is required configure xn file in project for your board schematics.
RitchRock
XCore Addict
Posts: 196
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

Have you verified the power supply sequencing and clock frequencies are correct? I don't see the full circuit in the image you sent. Would be useful to see your full power supply and clocking circuit with the CS2100. After that you might verify the connections from your diagram reflect the same pins as your code.
Dimitree
Junior Member
Posts: 5
Joined: Tue Sep 12, 2023 3:00 pm

Post by Dimitree »

mmar wrote: Wed Sep 13, 2023 5:58 pm Maybe you skip important point. Between 1 and 2 is required configure xn file in project for your board schematics.
Didn't know about that, sorry, I'm reading the AN00129 app notes to try to understand what I am missing
RitchRock wrote: Thu Sep 14, 2023 6:23 pm Have you verified the power supply sequencing and clock frequencies are correct? I don't see the full circuit in the image you sent. Would be useful to see your full power supply and clocking circuit with the CS2100. After that you might verify the connections from your diagram reflect the same pins as your code.
sorry, I thought that the schematic I posted was the entire circuit surrounding the XMOS, this is the full schematic of the project
infinitas.pdf
You do not have the required permissions to view the files attached to this post.
RitchRock
XCore Addict
Posts: 196
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

Have you checked the power supply sequencing and your clocks are behaving as expected when connecting to USB? Start with page 23 (section 13) for power supply sequencing and verify your timing looks acceptable. Go ahead and post screen shots from your scope if you can: https://www.xmos.ai/file/xe216-512-tq12 ... ion=latest

I also notice the C207 is 100nF when the USB spec calls for 1-10uF. See page 20 and figure 15 in the datasheet above.
Dimitree
Junior Member
Posts: 5
Joined: Tue Sep 12, 2023 3:00 pm

Post by Dimitree »

RitchRock wrote: Fri Sep 15, 2023 4:58 pm Have you checked the power supply sequencing and your clocks are behaving as expected when connecting to USB? Start with page 23 (section 13) for power supply sequencing and verify your timing looks acceptable. Go ahead and post screen shots from your scope if you can: https://www.xmos.ai/file/xe216-512-tq12 ... ion=latest

I also notice the C207 is 100nF when the USB spec calls for 1-10uF. See page 20 and figure 15 in the datasheet above.
thanks for the help..I replaced C207 with 10uF and it didn't fix the issue, but then I tried to check the power supply sequencing and noticed that the reset pin on the XMOS was always low..so I traced the signal backwards and found out that the issue was around the buffer IC204, replaced that IC and everything is working fine now.

thanks!
Dimitree
Junior Member
Posts: 5
Joined: Tue Sep 12, 2023 3:00 pm

Post by Dimitree »

So, after flashing both the XMOS and the FPGA, I noticed that the USB side is working fine (both on OSX and WIN), and the various signals (MCLK, LRCLK, BCLK) are correctly generated and routed out of the FPGA, but there is no audio in and out of the converters, so after checking the signals with a logic analyzer, I noticed that the SDA/SCL signals are not present at any time, so I guess the ADC/DAC cannot be initialized/configured to work.
The software running is a customized version of “app_usb_aud_xk_216_mc”. The code is here: https://github.com/freeDSP/freeDSP-INFI ... 216_mc/src.
What do you think could be the issue? I already checked for shorts or missing connections between those pins sources/destinations. Both SDA and SCL lines are always at logic HIGH.
complete schematics
RitchRock
XCore Addict
Posts: 196
Joined: Tue Jan 17, 2017 9:25 pm

Post by RitchRock »

Assuming your code is setup correctly for I2C, if SDA and SCL are always high, then perhaps your pull-up resistors on those lines need to be changed?

The code you linked does not include the module where your main () function is located or at least I didn't see it. I suggest you look at main() and verify your I2C task and pins are setup correctly and match the physical location on the chip pins.
Dimitree
Junior Member
Posts: 5
Joined: Tue Sep 12, 2023 3:00 pm

Post by Dimitree »

thanks for the help!
I checked again the pull-up resistors, they look fine under the DMM (2K value).

the "infinitas" code that I linked is based on the "app_usb_aud_xk_216_mc" application from this official XMOS package: XMOS USB Audio 2.0 Device Software Version: 6.15.2rc1"
Only the files which have been modified compared to the original project have been commited to the "infinitas" repository, not the whole application, that is why the "main()" module is missing.
I checked again the original application code, and the XK-AUDIO-216-MC-AB hardware (the board for which the original application is designed to run) and to me it seems to be coherent with the "infinitas" project in regards to I2C, since both projects have I2C on pins 37/38, and both declare:

Code: Select all

<Port Location="XS1_PORT_4A"  Name="PORT_I2C"/>
Also, I'm assuming the developer of the project has done the setup correctly.

I'm obviously missing something, because I don't know what else to check.

Another hypothesis that I have examined is that the CS2100 (I2C jitter reduction device connected to the XMOS and FPGA) was faulty (since I harvested it from a damaged board that suffered a long V+ to GND short) and that it could permanently hold the SDA/SCL lines to V+, but since I have a clock signal on the output of the CS2100, I'd say the chip could be fine.
User avatar
Ross
Verified
XCore Legend
Posts: 1077
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

Please post the output from the command xrun --dumpstate <binary_name>.xe, this might provide some clues.
Technical Director @ XMOS. Opinions expressed are my own