This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USB D+- as simple GPO how do this?

Hello!

In the description of the usb module, I found the registers: NRF_USBD->DPDMVALUE, NRF_USBD->TASKS_DPDMDRIVE and NRF_USBD->TASKS_DPDMNODRIVE

" State D+ and D- lines will be forced into by the DPDMDRIVE task. The DPDMNODRIVE task reverts the control of the lines to MAC IP (no forcing). "


It seems that the outputs of usb can be translated into several stable states.

I turned on the USB module, connected the VBUS, tried to set the values of the DPDMVALUE register to values 2 and 4, and then started the DPDMDRIVE task, but the state of the D + - pins did not change.

I would like to use these two lines to drive the LEDs as there are not enough I / O ports.

What I doing wrong?

Parents
  • Hi 

    I assume you are using the nRF52820?

    I don't think there is any way to manually override the state of the USB pins. These pins are handled by the USB IP, which takes care of the physical layer signalling, and only provides a higher level USB API to the rest of the system. 

    I will verify this with the USB developers to be sure. 

    Whether or not this is possible this would be using the chip outside it's specification, since we don't test these pins for any other use than as USB data pins. This is very risky as it means there might be negative side effects of using these pins, and you might end up with malfunctioning devices in the field. 

    I will strongly recommend that you look for alternative ways to handle the lack of IO, such as upgrading to a larger part (the nRF52833 for instance), attaching a GPIO extender, or revising your existing IO assignments to see if there is some other pins that can be optimized out. 

    If you want to share hardware schematics of your design I can make the case private. 

    Best regards
    Torbjørn

  • Hello!

    Yes, I use nRF52820.

    Best regards,

    Sergey Turnaev

  • Hi 

    I discussed this with the developer, and he agreed that it should be possible to override the data lines by using the DPDMVALUE registers, but please keep in mind that you can't control the two pins separately. 

    USB is a differential bus with the D+ and D- lines having the opposite state in normal operation, so at most you would get a single extra output signal. 

    Best regards
    Torbjørn

Reply
  • Hi 

    I discussed this with the developer, and he agreed that it should be possible to override the data lines by using the DPDMVALUE registers, but please keep in mind that you can't control the two pins separately. 

    USB is a differential bus with the D+ and D- lines having the opposite state in normal operation, so at most you would get a single extra output signal. 

    Best regards
    Torbjørn

Children
No Data
Related