-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPWM.INC
More file actions
43 lines (34 loc) · 792 Bytes
/
Copy pathPWM.INC
File metadata and controls
43 lines (34 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$NOLIST
;----------------------------------
; PWM.inc: Sets PWM Values
;----------------------------------
CSEG
Inc_PWM:
MOV A, Count1ms+0
CJNE A, Desired_PWM+0, Inc_PWM2
MOV A, Count1ms+1
CJNE A, Desired_PWM+1, Inc_PWM2
CLR OUTPUT_PIN
Inc_PWM2:
MOV A, Count1ms+0
CJNE A, #LOW(999), Return0
MOV A, Count1ms+1
CJNE A, #HIGH(999), Return0
SETB OUTPUT_PIN ;ToDo : Do We Need Swap Power Flag?
Return0:
RET
Power0: ; Called From States
CLR OUTPUT_PIN
RET
Power100: ; Called From States
SETB OUTPUT_PIN
RET
Power30: ; called from states
MOV Desired_PWM+0, #LOW(300) ; 30% Power
MOV Desired_PWM+1, #HIGH(300)
RET
Power60: ; called from states
MOV Desired_PWM+0, #LOW(600) ; 60% Power
MOV Desired_PWM+1, #HIGH(600)
RET
$LIST