Author Topic: External crystal required for low speed USB on CH32V203?  (Read 1196 times)

0 Members and 1 Guest are viewing this topic.

Offline eigenvektorTopic starter

  • Contributor
  • Posts: 41
  • Country: ch
External crystal required for low speed USB on CH32V203?
« on: April 25, 2023, 12:19:32 pm »
Sorry if this is a noob question but I just wanted to make sure,
the datasheet for the CH32V203 mentions a "Built-in factory-trimmed 8MHz RC oscillator" and a "Built-in PLL, optional CPU clock up to 144MHz", but no mention of tolerances. The datasheet also does not specify anything about crystalless USB.
Do I need to an external crystal if I only plan on using low speed usb (HID input device keyboard)? I have attached the datasheet.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4039
  • Country: nz
Re: External crystal required for low speed USB on CH32V203?
« Reply #1 on: April 25, 2023, 01:24:30 pm »
USB low speed needs a clock accurate to 1.5%.

According to table 4.3.6 the internal oscillator is accurate to within -1% to +1.6% between 0ºC and 70ºC.

So it should be ok.

Many devices take advantage of USB's 8b/10b encoding that guarantees a limited maximum time between level transitions to lock onto the USB clock by PLL or digital oversampling. IN that case you don't need a well calibrated clock at all. I didn't find any mention of this.
 

Offline eigenvektorTopic starter

  • Contributor
  • Posts: 41
  • Country: ch
Re: External crystal required for low speed USB on CH32V203?
« Reply #2 on: April 25, 2023, 01:27:56 pm »
Ah yes you're right, I overlooked that. Thanks!
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2300
  • Country: gb
Re: External crystal required for low speed USB on CH32V203?
« Reply #3 on: April 25, 2023, 01:48:56 pm »
If you want to avoid crystal for mechanical shock reasons, you could use a resonator for low speed.

Quote
Data Signalling Rate

Another area which is often overlooked is the tolerance of the USB clocks. This is specified in the USB specification, section 7.1.11.

    High speed data is clocked at 480.00Mb/s with a data signalling tolerance of ± 500ppm.
    Full speed data is clocked at 12.000Mb/s with a data signalling tolerance of ±0.25% or 2,500ppm.
    Low speed data is clocked at 1.50Mb/s with a data signalling tolerance of ±1.5% or 15,000ppm.

This allows resonators to be used for low cost low speed devices, but rules them out for full or high speed devices.

https://www.beyondlogic.org/usbnutshell/usb2.shtml#DataSignallingRate

 

Offline eigenvektorTopic starter

  • Contributor
  • Posts: 41
  • Country: ch
Re: External crystal required for low speed USB on CH32V203?
« Reply #4 on: April 25, 2023, 01:51:32 pm »
No just trying to save cost and board space, but I found ones for 10ct in 2x1.6mm so might throw on a crystal to be on the safe side.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: External crystal required for low speed USB on CH32V203?
« Reply #5 on: April 25, 2023, 03:28:06 pm »
Many devices take advantage of USB's 8b/10b encoding that guarantees a limited maximum time between level transitions to lock onto the USB clock by PLL or digital oversampling. IN that case you don't need a well calibrated clock at all. I didn't find any mention of this.
There's this in the RM, in chapter 21.1 Main Features of the USBD section:
Quote
* Frame locked clock pulse generation
It might be related to some kind of self synch, but I could not find much else.
Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: eigenvektor

Offline eigenvektorTopic starter

  • Contributor
  • Posts: 41
  • Country: ch
Re: External crystal required for low speed USB on CH32V203?
« Reply #6 on: April 25, 2023, 03:38:06 pm »
Ouh that is actually very interesting information I was completely missing in the datasheet specific to the CH32V203, thank you very much :)
I was wondering how come that one was so sparse of information.
 

Offline eigenvektorTopic starter

  • Contributor
  • Posts: 41
  • Country: ch
Re: External crystal required for low speed USB on CH32V203?
« Reply #7 on: April 25, 2023, 03:57:09 pm »
From the reference manual (see attachment)
There seems to be a "USB HS PLL" present providing 480 MHz, although I'm not knowledgeable enough to make any conclusions from that...
Edit: this is actually for the CH32V305, for the CH32V203 see the second attachment. Reading is a useful skill sometimes.
« Last Edit: April 25, 2023, 04:02:36 pm by eigenvektor »
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4039
  • Country: nz
Re: External crystal required for low speed USB on CH32V203?
« Reply #8 on: April 25, 2023, 11:12:19 pm »
Knowing what to look for helps too.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf