What exactly is required to run USB on an nRF52840 without an external crystal?

Long story short, I trusted the datasheet (big mistake) where it says an external crystal is optional. In previous builds, I had an external crystal onboard anyway, so this issue never arose, but now I don't want an external crystal, but it turns out the "optional" marking in the datasheet really means "there's no easy way to do this, oh ya, and no clear guide either".

1. I have no external crystal oscillator, how can I use USB as an HID device still?

2. Can I still use BLE reliably without the external crystal? I'm depending on 7.5ms intervals, 16 Kb/s throughput.

Please don't paste minute code snippets without telling me where to paste them. Thank you!

Parents Reply Children
  • Hi,

     

    Bk37 said:
    Why does it specifically mark a 32 KHz crystal as "optional" if a crystal is not optional at all?

    32 MHz is required, while the 32.768 kHz is optional. Please see the former:

    Håkon Alseth said:

    As mentioned in the comments here, the 32.768 kHz external crystal is optional, but the 32 MHz one is required:

    https://docs.nordicsemi.com/bundle/ps_nrf52840/page/ref_circuitry.html

     

    Could you please confirm your circuitry?

     

    Kind regards,

    Håkon

  • I am using a 3rd party board with this chip, after doing some research, it turns out that it does in fact include an external 32 MHz crystal, it does NOT include a 32 KHz crystal.

    Should USB still will under this layout? As far as my research tells me, if the 32 MHz crystal would suffice for USB, it would be automatic, like it's automatic when a 32 KHz crystal is connection.

    This is the schematic we are using:

  • Hi,

     

    That is great! The module does indeed have a 32 MHz xtal in-place.

    Bk37 said:
    Should USB still will under this layout? As far as my research tells me, if the 32 MHz crystal would suffice for USB, it would be automatic, like it's automatic when a 32 KHz crystal is connection.

    R30 and R31 should be 0-ohm, as the resistors are internal to the nRF.

    Other than that, I do not see any issues.

     

    XTAL will be requested by the driver itself, so no worries there.

     

    To select internal 32k RC oscillator for your LFCLK, please append this option to your project:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

      

    Kind regards,

    Håkon

  • I added that line to the prj.conf, but still no change. When the device is plugged into USB, it's receiving power, and VDD is even outputting the proper voltage, but no device is showing up on my PC. Again, the only difference between this and my other functional board is the external 32 KHz oscillator.

  • Hi,

     

    Sorry, I oversaw that your device is in LDO operation.

    If you are on the latest NCS v2.9.0, you should add this to the overlay (example: nrf52840dk_nrf52840.overlay) file:

    &reg1 {
    	regulator-initial-mode = <NRF5X_REG_MODE_LDO>;
    };

     

    Or if you are using older version, you can add this to your prj.conf:

    CONFIG_BOARD_ENABLE_DCDC_HV=n
    CONFIG_BOARD_ENABLE_DCDC=n

     

    Kind regards,

    Håkon

     

Related