adityasreekumar
New Member
How can i control the speed of a bldc motor using pwm signals from a pic16f877... i onle need to decrease and increase the speed, no need of bidirectional control....
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
dim i as result //alias to adc result
dim pin1 as PORTB.0 //alias for port pins
dim pin2 as PORTB.1
dim pin3 as PORTB.2
dim pin4 as PORTB.3
PORTB = %00000000 // sets portb low
TRISB = %00000000 // sets portb to outputs
while true // start of loop
pin1 = 1 // sets high
delayms(i) // i changes as you change potentiometer changing the delay
pin1 = 0
pin2 = 1
delayms(i)
pin2 = 0
pin3 = 1
delayms(i)
pin3 = 0
pin4 = 1
delayms(i)
pin4 = 0
wend // end of loop will keep looping as long as true