Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pwm code for 89s52
#1

sir i want to have the code for 89s52 microcontroller to control speed of dc motor with using L293d motor driver i have a code shown below but it is not converting to the hex file in keil detecting error sir please this is humble request to make a favour and make a code speed controlling the speed of small dc motor with 90% 50% and 10% power please sir help me out this my last project in the last year for engineering please help me out the code is shown below..

org 0x00

jnb p1.4,main

main:

mov r7,#160

call pwm_init

org 0x0b

jb f0,low_cycle

jnb p1.3,low_cycle1

high_cycle:

setb f0

setb p1.1

mov th0,r7

clr tf0

reti

low_cycle:

clr f0

clr p1.1

mov a, #00H

clr c

subb a, r7

mov TH0, a

clr TF0

reti

low_cycle1:

clr f0

clr p1.1

mov a, #0FFH

clr c

subb a, r7

mov TH0, A

clr TF0

reti

pwm_init:

mov tmod,#00H

inc r7

setb EA

setb ET0

setb TR0

jmp pwm_init

end
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2024 iAndrew & Melroy van den Berg.