ตารางคำนวณการสร้าง PWM บน PIC16F886
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

 
$
%
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
2
Input
3
MCU Frequency8MHz
4
PWM Period (ms)2.048Resulting frequency0.48828125kHz
5
PWM Duty (%)1Resulting ON time0.04194304ms
6
7
Result
8
9
Peroid Configuration
PWM Peroid = (4/MCU Frequency) * Timer2 Mode * (Timer2 Peroid + 1)
10
Timer2 Mode
Timer2 Period (0-255)
Result (ms)Error (%)
11
setup_timer2()140952.0480
12
410232.0480
13
162552.0480
14
15
16
Duty Configuration
PWM Duty (ms) = (1/MCU Frequency) * Timer2 Mode * Duty Value
17
Timer2 ModeDuty ValueResult (ms)Error (%)
18
set_pwm1_duty()13350.041875-0.001622200012
19
4830.0415-0.01056289673
20
16200.04-0.04632568359
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Loading...
Main menu