This is my school project. I am using PIC16F628A to control the luminance of a LED. the test code is below :
include "modedefs.bas"
symbol RB4=PORTB.4
main:
pwm PORTB.4, 0, 400
pwm PORTB.4, 127, 400
pwm PORTB.4, 256, 400
goto main
end
i am using 4 MHZ internal clock and each duty crycle consume 5ms. My led is connected to PORTB.4 . i had try 0, 50, and 100 percent of duty cycle and hold each for 2 seconds.
But my led just ond when my duty crycle is 100% and it is off for other duty crycle... May someone help me to solve this problem?
include "modedefs.bas"
symbol RB4=PORTB.4
main:
pwm PORTB.4, 0, 400
pwm PORTB.4, 127, 400
pwm PORTB.4, 256, 400
goto main
end
i am using 4 MHZ internal clock and each duty crycle consume 5ms. My led is connected to PORTB.4 . i had try 0, 50, and 100 percent of duty cycle and hold each for 2 seconds.
But my led just ond when my duty crycle is 100% and it is off for other duty crycle... May someone help me to solve this problem?