wagiminator / CH32X035-USB-PD-Tester

USB Power Delivery Testing Device and Variable Power Supply
https://oshwlab.com/wagiminator/ch32x035-usb-pd-tester
Other
116 stars 11 forks source link

Restart in case of PPS #5

Open norbiv8 opened 2 months ago

norbiv8 commented 2 months ago

Hi, I rebulilt this project following your instructions which made the process smooth, thanks. I found that when I want to use PPS voltages the power supply and/or circuit restarts after some seconds after I set the desired voltage. With the fixed voltages (5V, 9V etc.) the issue is not appear. Tested with UGREEN 65W, 100W and SJÖSS (IKEA) 30W power supply too, all of them producing same issue. Lastly I tried with a cheap noname Aliexpress one which works without problem. The CH32X035-USB-PD-Adapter behave very same. Have you tried with one of the power supplies above?

wagiminator commented 2 months ago

Hi, thanks a lot for the information. I don’t have such a power supply myself; mine are all actually from Aliexpress. Could you please try if it works with a load connected to the output? Maybe the power supply shuts off if not enough current flows for a while (as an energy-saving measure). I know something like that, at least, from power banks.

norbiv8 commented 2 months ago

Hi Stefan, thanks for good idea, it didn't come into my mind. During a test with 500mA load (it should be enough to keep alive the power supply) it producing same issue unfortunately. It looks like I have to dig into details to understand the root cause. Did you use the chip manufacturer example code for yor project?

wagiminator commented 2 months ago

That's a shame, but I guess that would have been too easy.

I closely followed the manufacturer’s implementation, but of course, it’s quite possible that I may have overlooked something. What’s interesting is that the negotiation seems to work initially. Maybe it needs to be repeated regularly in this case. If you ever have a lot of time and feel like it, you could try testing the manufacturer’s implementation.

norbiv8 commented 2 months ago

I thought that it will be an easy Saturday afternoon project :D

Anyway, I hooked up logic analyzer to CC line, after negotiation or voltage set there is no regular communication on the line in case of the noname power supply. In case of UGREEN power supply the restart happens 13.8-13.9sec after last frame. I'm going to check the spec, it might necessary to initiate communication regularly as you wrote. Just for curiosity I tried to decode the CC line, it is not perfect I mean not all frames decoded. increase_pps_to_5050mV_noname.txt increase_pps_to_5050mV_ugreen.txt negotiation_after_power_up_noname.txt negotiation_after_power_up_ugreen.txt restart_event_ugreen.txt

Edit: Yes, PPS needs keep alive communication (section 6.6.19 in spec), nominal timeout value is 13.5sec which is corresponding to my measurements. Do you have plan to implement this into your project?

wagiminator commented 2 months ago

What do you think, how many times I’ve looked forward to relaxed weekend projects? ;-)

Aha, that probably explains the problem. I guess I’ll have to take another look. Could you please try and see if the issue also occurs when you increase/decrease the requested voltage after about 10 seconds?

wagiminator commented 2 months ago

I thought this was supposed to be a quiet Sunday morning :D

Try the updated version.

norbiv8 commented 2 months ago

I confirm it works with fiexd and PPS voltages too. Thanks!

wagiminator commented 2 months ago

Great!