AT89S52 inverter need help

Status
Not open for further replies.

jayM

Newbie level 2
Joined
Apr 15, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
i try to program AT89S52 to generate PWM for my inverter but it not work....
can somebody help me to write asm code.
 

PWMPIN EQU P3.0
PWMPIN EQU P3.1
PWM_SETUP:
MOV TMOD,#00H
MOV R7, #160
SETB EA
SETB ET0
SETB TR0
RET

TIMER_0_INTERRUPT:
JB F0, HIGH_DONE
LOW_DONE:
SETB F0
SETB PWMPIN
MOV TH0, R7

CLR TF0
RETI

HIGH_DONE:
CLR F0
CLR PWMPIN
MOV A, #0FFH
CLR C
SUBB A, R7
MOV TH0, A
CLR TF0
RETI

i use this code to generate PWM for inverter....
can some one give a comment or suggestion about this code
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…