Chip-cn-dat/WCH-dat/CH224-dat/CH224-dat.md
... ...
@@ -6,7 +6,9 @@
6 6
- datasheet == [[ch224ds1.pdf]]
7 7
8 8
9
-CH224Q/CH224A are USB PD fast charging protocol sink chips supporting USB PD3.2, with a maximum PD3.2 EPR power of 140W. They support single resistor configuration, I/O level configuration, and I2C configuration. The protocol handshake status and current PD voltage/current rating can be read via the I2C interface. The chip has a built-in high-voltage LDO, low static power consumption, high integration, and simplified external circuitry. It also integrates output voltage detection and overvoltage protection, making it widely applicable for expanding high-power input in various electronic devices such as wireless chargers, small appliances, lithium battery power tools, and more.
9
+CH224Q/CH224A are USB PD fast charging protocol sink chips supporting USB PD3.2, with a maximum PD3.2 EPR power of 140W.
10
+
11
+They support single resistor configuration, I/O level configuration, and I2C configuration. The protocol handshake status and current PD voltage/current rating can be read via the I2C interface. The chip has a built-in high-voltage LDO, low static power consumption, high integration, and simplified external circuitry. It also integrates output voltage detection and overvoltage protection, making it widely applicable for expanding high-power input in various electronic devices such as wireless chargers, small appliances, lithium battery power tools, and more.
10 12
11 13
CH224K/CH224D/CH221K are USB PD fast charging protocol sink chips supporting USB PD3.0, with a maximum power of 100W. They support single resistor configuration and I/O level configuration.
12 14
... ...
@@ -22,6 +24,10 @@ Features
22 24
- Built-in overvoltage protection module (OVP)
23 25
24 26
27
+
28
+CH224 is a USB PD sink controller, supports fast charge protocols such as PD3.0/2.0 and BC1.2, supports 4V to 22V, and can dynamically configure the request-voltage through multiple methods.
29
+
30
+
25 31
## SCH
26 32
27 33
![](2025-08-19-16-44-14.png)
Tech-dat/acturator-dat/motor-dat/servo-dat/servo-dat.md
... ...
@@ -89,6 +89,21 @@ Taking the 180-degree angle servo as an example, the corresponding control relat
89 89
}
90 90
91 91
92
+
93
+## servo calibration
94
+
95
+
96
+## 1. Mechanical Calibration
97
+
98
+1. Power the servo and send 1500 µs signal (center pulse).
99
+2. Remove the servo horn (the arm).
100
+3. Reattach the horn so it points exactly to the middle.
101
+
102
+✅ Best method — keeps full 0–180° movement range.
103
+
104
+
105
+
106
+
92 107
## FAQs
93 108
94 109
### Can a Servo Hold Position When Power Is Off?
Tech-dat/acturator-dat/motor-dat/servo-dat/servo-sdk-dat.md
... ...
@@ -0,0 +1,70 @@
1
+
2
+# servo-sdk-dat.md
3
+
4
+- ESP32Servo
5
+
6
+## 'ledcSetup' was not declared in this scope
7
+
8
+
9
+If you prefer to use the latest ESP32 core version, you need to update your code to reflect the new LEDC API.
10
+- `ledcSetup() and ledcAttachPin()` are no longer used.
11
+- You can now use `analogWrite(pin, value)` for basic PWM, where value is the duty cycle.
12
+- For more advanced control, use `ledcAttachChannel(pin, freq, resolution, channel)` to attach a pin to a specific PWM channel and then `ledcWrite(pin, duty)` to set the duty cycle. The channel will be automatically attributed if not specified.
13
+
14
+
15
+### New Code (ESP32 Core >= 3.0.0):
16
+
17
+```
18
+const int LED_PIN = 2;
19
+const int FREQ = 5000;
20
+const int RESOLUTION = 8; // Not directly used in ledcWrite(), but useful for calculating duty cycle
21
+
22
+void setup() {
23
+ // Option 1: Use analogWrite for basic PWM
24
+ // analogWrite(LED_PIN, 128); // Sets initial duty cycle
25
+
26
+ // Option 2: Use ledcAttachChannel for more control
27
+ ledcAttachChannel(LED_PIN, FREQ, RESOLUTION, 0); // Attaches pin to channel 0
28
+}
29
+
30
+void loop() {
31
+ // Option 1: Use analogWrite
32
+ // analogWrite(LED_PIN, 128);
33
+ // delay(1000);
34
+ // analogWrite(LED_PIN, 0);
35
+ // delay(1000);
36
+
37
+ // Option 2: Use ledcWrite
38
+ ledcWrite(LED_PIN, 128); // 50% duty cycle for 8-bit resolution
39
+ delay(1000);
40
+ ledcWrite(LED_PIN, 0);
41
+ delay(1000);
42
+}
43
+
44
+```
45
+
46
+### Old Code (ESP32 Core < 3.0.0):
47
+
48
+```
49
+const int LED_PIN = 2;
50
+const int FREQ = 5000;
51
+const int LED_CHANNEL = 0;
52
+const int RESOLUTION = 8;
53
+
54
+void setup() {
55
+ ledcSetup(LED_CHANNEL, FREQ, RESOLUTION);
56
+ ledcAttachPin(LED_PIN, LED_CHANNEL);
57
+}
58
+
59
+void loop() {
60
+ ledcWrite(LED_CHANNEL, 128); // 50% duty cycle for 8-bit resolution
61
+ delay(1000);
62
+ ledcWrite(LED_CHANNEL, 0);
63
+ delay(1000);
64
+}
65
+```
66
+
67
+
68
+## servo 360
69
+
70
+