Download Print this page

STC micro STC8A8K64D4 Series Reference Manual page 570

Advertisement

STC8A8K64D4 Series Manual
{
P0M0 = 0x00;
P0M1 = 0x00;
P1M0 = 0x00;
P1M1 = 0x00;
P2M0 = 0x00;
P2M1 = 0x00;
P3M0 = 0x00;
P3M1 = 0x00;
P4M0 = 0x00;
P4M1 = 0x00;
P5M0 = 0x00;
P5M1 = 0x00;
PWMSET = 0x01;
the module is enabled.)
P_SW2 = 0x80;
PWMCKS = 0x00;
PWMC = 0x0800;
PWM0T1= 0x0100;
PWM0T2= 0x0700;
PWM1T2= 0x0080;
PWM1T1= 0x0780;
PWM0CR= 0x80;
PWM1CR= 0x80;
P_SW2 = 0x00;
PWMCFG = 0x01;
while (1);
}
Assembly code
;Operating frequency for test is 11.0592MHz
P_SW2
DATA
PWMSET
DATA
PWMCFG
DATA
PWMCH
EQU
PWMCL
EQU
PWMCKS
EQU
PWMTADCH
EQU
PWMTADCL
EQU
PWMIF
EQU
PWMFDCR
EQU
PWM0T1H
EQU
PWM0T1L
EQU
PWM0T2H
EQU
PWM0T2L
EQU
PWM0CR
EQU
PWM0HLD
EQU
PWM1T1H
EQU
PWM1T1L
EQU
PWM1T2H
EQU
0BAH
0F1H
0F6H
0FF00H
0FF01H
0FF02H
0FF03H
0FF04H
0FF05H
0FF06H
0FF10H
0FF11H
0FF12H
0FF13H
0FF14H
0FF15H
0FF18H
0FF19H
0FF1AH
//Enable PWM module (The configuration is effective only after
//The clock of PWM is the system clock
//Set the PWM cycle to 0800H PWM clocks
//At the count value of 100H, PWM0 outputs low level.
//At the count value of 700H, PWM0 outputs high level.
//At the count value of 0080H, PWM1 outputs high level.
//At the count value of 0780H, PWM1 outputs low level.
//enable PWM0 output
//enable PWM1 output
//Start PWM module
- 554 -

Advertisement

loading
Need help?

Need help?

Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin