Migrating from XHRA to XU208

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
MDuprau
Junior Member
Posts: 6
Joined: Wed Sep 26, 2018 11:27 pm

Re: Migrating from XHRA to XU208

Postby MDuprau » Mon Oct 01, 2018 3:12 pm

mon2 wrote:Mark,

1) try to boot a simple led blinky code on your custom pcb. Does that boot from your flash and work?

2) if yes, try different usb cables that are fully loaded (4 wires) and your usb audio ip. Work? No, then apply xmos usb ip like usb cdc, usb hid to validate if any usb ip works on your pcb.

3) if still failing, post relevant parts of your schematic in pdf format for a review.
Hello,

thnx for your answers, but in the first step will eleminate the posible "problems" i already postet here :
[?] gpio_defines.h @ sw_usb_audio\app_usb_aud_xu208_xhra\src\extensions is right ?
#define P_GPO_LED_A 0
#define P_GPO_LED_B 1
#define P_GPO_MCLK_SEL 3
[?] reason why "set_gpio((1<<P_GPO_DAC_RST_N), 1);" can/must replace "set_gpio(1<<P_GPO_MCLK_SEL, 1);" ?
[?] compile project "app_usb_aud_xu208_xhra" with "Makefile" -> Target "xhra_xcore" (default) for the "XU208-128-TQ64-C10" ?
[?] HEX-Dump from "app_usb_aud_xu208.bin" : "7d 30 00 00 f3 37 00 09 00 b5 00 00 00 00 02 00" it looks differently from other BIN-files i have seen here, is that the right start sequence ?
[?] initialisation/update for the XMOS flash "IS25LQ016B-JNLE" goes over a ATXMEGA (XU208-128-TQ64-C10 is offline in this case), is there a need to change the data from "app_usb_aud_xu208.bin" or can it program one by one ?

Best regards Mark Duprau
MDuprau
Junior Member
Posts: 6
Joined: Wed Sep 26, 2018 11:27 pm

Postby MDuprau » Tue Oct 02, 2018 7:57 am

Hello,

implement a logic analyses over a "Saleae Logic Pro 8" :
- 3V3 @ 0.211.45s
- RST @ 0.222.58s
- D0H @ 0.222.617.50s (D0 to High)
- CS @ 0.222.617.76s
- BGN @ 0.222.62s
- END @ 0.227.47s
- NXT @ 0.659.52s
- END @ 0.664.38s
- NXT @ 1.096.43s
- END @ 1.101.29s
- NXT @ 1.533.34s
- END @ 1.538.20s
... and so on, the XU208 get the code from flash again and again

Best Regards Mark Duprau
MDuprau
Junior Member
Posts: 6
Joined: Wed Sep 26, 2018 11:27 pm

Postby MDuprau » Tue Oct 02, 2018 8:14 am

Hello,

and the timing for 3V3, 1V0, RST :
- 3V3 @ 0.233.92s
- 1V0 @ 0.234.15s
- RST @ 0.244.99s

Best Regards Mark Duprau
MDuprau
Junior Member
Posts: 6
Joined: Wed Sep 26, 2018 11:27 pm

Postby MDuprau » Wed Oct 03, 2018 6:30 pm

Hello,

after the hardware-check with the "saleae pro 8" i go back to check the software/firmware/project, maybe not all of the following steps are necessary :

#1 change inside the "Makefile" the "Target" from "xhra_xcore.xn" to "XUF208-128-TQ64-C10 Device" and import the "XUF208-128-TQ64-C10.xn" (why is inside the "xhra_xcore.xn" the "XUF208-256-TQ64-C20" ?)
#2 import the "Audio Ports" and "USB Ports" sections from "xhra_xcore.xn" to "XUF208-128-TQ64-C10 Device.xn", include some other small delta
#3 make a "Clean"
#4 change some of the hooks from "Used Modules" and remove some unused "#includes" so that the error msg count to zero
#5 make a "Build Project"
#6 convert the new "XE" to "BIN" and but it on the flash one by one

Power on ... Connect LED on, Device online on USB, Audio stream works but sound is bad, the reason the interface wait for a "LJ" signal.
Some changes on die "module_audio_usb/audio.xc" like "p_lrclk <: 0x80000000;" to "p_lrclk <: 0x00000000;" and "p_lrclk <: 0x7FFFFFFF;" to "p_lrclk <: 0xFFFFFFFF;" ... enable "LJ" and everything works fine.
Next steps is to clean up a bit and remove some of the unused functions.

Best Regards Mark Duprau
DHembree
Experienced Member
Posts: 75
Joined: Fri Apr 15, 2016 6:46 pm

Postby DHembree » Thu Oct 04, 2018 3:13 pm

I've asked this question in a separate post, but I feel it needs to be asked within the the context of this thread...

Has anyone had experience using the variable samRes_DAC as it is passed to AudioHwConfig in audiohw.xc within this XHRA to XU208 framework?

It appears to work in app_usb_aud_xk_216_mc, but within app_usb_aud_xu208_xhra it is always 32 regardless of the incoming stream resolution.

PLEASE HELP!
User avatar
Wavelength
Member++
Posts: 21
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Tue Oct 09, 2018 5:04 pm

In the customdefines.h you may want to comment out this line:

/* Resolution of PCM interface */
#define HS_STREAM_FORMAT_OUTPUT_1_RESOLUTION_BITS 32

I am not sure if that is what is causing your problem but I did notice the same thing in my setup.

Thanks,
Gordon
Wavelength Audio, ltd.
User avatar
Wavelength
Member++
Posts: 21
Joined: Mon Sep 24, 2018 9:56 pm

Postby Wavelength » Tue Oct 09, 2018 5:10 pm

infiniteimprobability,

Hey thanks for your source code. I tried the AN1027 app note and had a terrible time as things would crash and code would not be implemented correctly because of the ifdefs. I spent 3 weeks on 3 different computers a total of six times from scratch and I had no luck in getting anything to work. Taking that XU216 code base and adapting it to the XU208 is just a bit silly.

I took your code ported to the 48pin part on my board in about 4 hours.

I wish I would have started with you code first as I might have been done by now.

Thanks again,
Gordon
Wavelength Audio, ltd.
Dean2Loris
New User
Posts: 2
Joined: Sun Oct 14, 2018 1:19 pm

Postby Dean2Loris » Sun Jan 20, 2019 9:46 am

sleepfox wrote:Hi, Mon2,

Thanks for checking the schematics for me.

1) R3 is 10K ohm. The output voltage is formed by dropping 100uA constant current on this resistor. 10Kohm*100uA should gives an output voltage of 1V. R4 is 4.7ohm, as in the original XHRA schematics. It forms a RC network with a 0.1uf cap and 1V power supply for PLL_AVDD. R5 is 43.2ohm as in the XUF208 datasheet -- to pull USB-Rtune to ground through this resistor.

2) LT3045 also has power monintor function. PG pin is a open-collector output that pulls low when PGFB sense a voltage under the threshold of 0.3V. Therefore you may use a pair of resistors that divides the output voltage, for example, if the lower position resistor is half of the upper resistor, then PGFB sense 1/3 of output voltage -- when the output voltage is less than 0.9V, then PG will pull low (since PGFB is below threshold of 0.3V). Originally I thought this could be a very neat way to satisfy the required reset time when XMOS boots. However, according to XUF208 datasheet, "RST_N and must be asserted low during and after power up for 100 ns" and I am not sure this timeing requirement could be met with LT3045's power monitor function. I ended up abondoning this idea and adding a STM6717. Have to play safe on this one since 4-layer pcb and xmos chip are not cheap. I am very interested to see if this idea ofpower monitor works though. If any one ever try it with success, do let me know. Thanks.

3) According to 1) and 2), the two resistors in the attched figure do not define output voltage, they could be used in a way that PG pin monitors output voltage though, they can also be added so that the LT3045 has a fast startup, which is the purpose of the schematics that you attached. R3 (which connects the SET pin to ground) defines the output voltage.

Thanks again.
Has anyone had experience using the variable samRes_DAC as it is passed to AudioHwConfig in audiohw.xc within this XHRA to XU208 framework?
victor750
Newbie
Posts: 1
Joined: Fri Mar 22, 2019 8:06 am

Postby victor750 » Fri Mar 22, 2019 8:16 am

Hello
I’m totally new in xTimecomposer and programming.
Could somebody to describe step-by-step how to build firmware witch xmos software?
It is not clear for me, what should I use: 6.15.1rc2 reference design or xhra2xu208_1v0 (or use that files simultaneously?)?
I will be grateful for your help.

Best Regards Victor750
Krzysiek
Newbie
Posts: 1
Joined: Mon Apr 29, 2019 6:02 pm

Postby Krzysiek » Mon Apr 29, 2019 6:26 pm

Hello,

I followed through AN01027 to prepare software for new chip. Unfortunately something is still wrong with my setup. Building project is stuck with following errors:
Description Resource Path Location Type
parse error before "XUD_Manager" main.xc /module_usb_audio line 11 C/C++ Problem
Description Resource Path Location Type
'AUDIO_CLASS' is not defined, evaluates to 0 main.xc /module_usb_audio line 6 C/C++ Problem

xTIME Composer Studio is showing that error is located in "main.xc", basically this file is copy paste from application note:

/* USB Interface Core */
{
#ifdef U208_ONLY
set_core_high_priority_on();
#endif
#if (AUDIO_CLASS==2)
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_HS, XUD_PWR_CFG);
#else
XUD_Manager(c_xud_out, ENDPOINT_COUNT_OUT, c_xud_in, ENDPOINT_COUNT_IN,
c_sof, epTypeTableOut, epTypeTableIn, p_usb_rst,
clk, 1, XUD_SPEED_FS, XUD_PWR_CFG);
#endif
}

Could someone advise what is wrong with this code? I'm not a software expert...

Thanks in advance,
Best regards,
Krzysiek

Who is online

Users browsing this forum: No registered users and 1 guest