Hi,
the reference manual v1.4 says
37.4.5 Frame toggle output
The USB1_FRAME output pin reflects the 500 kHz clock (full-speed mode) or the 4 kHz
clock (high-speed mode) derived from the incoming Start of Frame tokens sent by the
USB host.
I think the fs frame toggle clock (derived from SOF) should be 1kHz, but it is 500Hz (not kHz...).
When in peripheral view in mcuxpresso 11.5.0 the possible values for the CT32BIT_CAP_SEL[0]_CT32BIT_CAP_SEL0 register are shown in decimal but with 0x prefixed. The svd file seems correct.
The usb audio demos (sdk 2.11) use
#if (defined USB_DEVICE_CONFIG_LPCIP3511FS) && (USB_DEVICE_CONFIG_LPCIP3511FS)
/* The USB_SOF_TOGGLE's frequency is 1kHz. */
#define AUDIO_PLL_USB_SOF_INTERVAL_TICK_COUNT (24576U * AUDIO_PLL_ADJUST_INTERVAL)
#define AUDIO_FRO_USB_SOF_INTERVAL_COUNT (96000U * AUDIO_FRO_ADJUST_INTERVAL)
#elif (defined USB_DEVICE_CONFIG_LPCIP3511HS) && (USB_DEVICE_CONFIG_LPCIP3511HS)
/* The USB_SOF_TOGGLE's frequency is 4kHz. */
#define AUDIO_PLL_USB_SOF_INTERVAL_TICK_COUNT (24576U * AUDIO_PLL_ADJUST_INTERVAL / 4U)
#endif
- so they always assume 4kHz no matter if the usb speed is full or high speed. That ultimately leads to audio corruption.
And to top it off: if connected to a high speed capable hub the speed is set to full speed.
Not sure if TN00071 could help in that case - still experimenting. The function USB_DeviceHsPhyChirpIssueWorkaround(); in the source code that comes with the tn is not implemented... I still found it hidden in some other sdk example... And I'm not sure how the DeviceHsPhyChirpIssue relates to the errata sheet.
And the ref manual says about plls:
// Remark: it is possible to change the fraction while a PLL is operating, but only NUM
// should be changed, and only by a step of 1 at a time (with a delay at each change for the
// PLL to settle to the new setting). DENUM should not be changed while a PLL is running.
However this contradicts the register description of AUDIOPLL0NUM:
//Remark: if the PLL numerator and denominator are set up and subsequently altered while
//the PLL is running, the amount of change on a single step of the NUM should be limited to
//100 ppm of the current setting.
// NOTES:
// 1. The value of numerator must always be configured to be less than the value of the
// denominator.
// 2. The AUDIOPLL0NUM register can only be changed when the AUDIOPLL0 is disabled.
The audio demos set the running audio pll numerator to some calculated value, I don't know yet if that is within 100ppm of the current setting. Either way the manual is riddled with contradicting statements.
Hello fatalerror,
1.About USB1_FRAME_TOGGLE pin frequency
There is a typo in the manual, the actual situation is
For USB1_FRAME_TOGGLE pin, FS - 500Hz, HS - 4kHz
In FS mode, the frame interrupt comes every 1ms, at this time USB1_FRAME_TOGGLE pin toogles once, shows in the figure below. So the frequency of USB1_FRAME_TOGGLE pin is 500Hz(2ms is a cycle).
2.About the modification of Audio PLL
Sorry for the confusion in the manual.
During operation, the NUM parameter can be modified, but the DENUM parameter cannot be modified. And the amount of change on a single step of the NUM should be limited to 100 ppm of the current setting.
Best Regards,
Tongtong Zhai