By outputting the PWM wave, it outputs a constant voltage to the USB D+D- pin after RC low-pass filtering, and monitors the voltage changes in real time through the ADC. Considering that the push-pull output of this microcontroller has a high current draw, the pull-up resistors R1 and R2 do not need to be welded (actually it was a design mistake at the beginning). See attachment for source code
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet