How to change VBUS Valid threshold value? (4.4V to 4.1V)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change VBUS Valid threshold value? (4.4V to 4.1V)

896 Views
stanley-kylee
Contributor II

Hello.

I want to change VBUS Valid threshold value.

According to the RT1020 reference manual, the valid state of VBus can be checked by checking AVV (A VBus Valid). However, this value is Read Only.

I found 'USB VBUS Detect Register' in the reference manual. It seems that the 'VBUSVALID_THRESH' of this register is adjustable from 4.0V to 4.7V, and 4.4V is confirmed as the default value. I actually confirmed that AVV was detected or not detected based on 4.4V.

I want to change this value to 4.1V.
It only needs to change the AVV state when a voltage of 4.1V or higher is applied.

It seems that the USB_ANALOG Register Masks part of the RT1021 header file (MIMXRT1021.h) adjusts the value, but I'm not sure.

How to change VBUSVALID_THRESH value from 4.4V to 4.1V?

Thank you for your reply. Have a nice day.

 

0 Kudos
Reply
2 Replies

854 Views
PabloAvalos
NXP TechSupport
NXP TechSupport

Dear @stanley-kylee 

 

Thanks a lot for reaching our technical support.

 

Regarding your question, in order to have this 4.1V on the VBUSVALID_THRESH, you just have to re-define with another name or sending to the macro USB_ANALOG_VBUS_DETECT_VBUSVALID_THRESH(x), the "x" with the corresponding value shown in green (in this case 0b001 = 0x01U):

PabloAvalos_0-1677194771837.png

 

Hope that is helpful for you!

 

Best Regards.
Pablo Avalos.

0 Kudos
Reply

840 Views
stanley-kylee
Contributor II

Hello @PabloAvalos 
Thank you for your reply.

Where should I send the "USB_ANALOG_VBUS_DETECT_VBUSVALID_THRESH(0x1U)" macro value?
Or can I just use the code below?

uint32_t tmp32 = ehciRegisterBase->OTGSC;
tmp32 |= USB_ANALOG_VBUS_DETECT_STAT_VBUS_VALID(0x1U);
ehciRegisterBase->OTGSC = tmp32;

However, since VBUSVALID_THRESH is related to USB ANALOG, it does not seem to be set in the OTGSC register.
More detailed information please.

Thank you.

0 Kudos
Reply