How to make PWM to all the pins at the portB in same time on 16f628

Başlatan kengur, 15 Aralık 2010, 15:21:30

kengur

How to make PWM to all the pins at the portB in same time on 16f628
or is there another command: for example, eight LEDs connected portb 0,1,2,3,4,5,6,7 to work with 50% at the same time.
At the same time to light and perish one by one with 100%.
but never to perish under 50%.

please help


neural

Hi, is it be syncronize RB3/PWM out pin?

If it will not syncronize,  you can use software pwm. You must use
PORTB = 0x00 or PORTB = 0xFF instead of set or clear commands.

As far as I know, there isn\'t command for pwm of all pins you can do in picbasic.


kengur

I like all the pins to be light with 50%, at the same time to high and low one by one. but never below 50%

neural

loop:
  PauseUs 200
  PORTB = 0xFF
  PauseUs 200
  PORTB = 0x00
goto loop

This code can handle the your job. OFF and ON time of leds are same. You can change \"200\" value for different frequencies at \"PauseUs 200\"  command.

 
Also can you share your code? I can help you more, maybe.

kengur

http://picprojects.org.uk/projects/ledchaserpwm/index.htm
vivi this. In assembly language, I do not understand assembly,
Watch the clip 1.30 to 1.50 min. That I want to do but do not know how the  PICBASIC PRO


Hızlı Yanıt

Not: Bu konu bir moderatör tarafından onaylanmadan görüntülenmeyecektir.

Adı:
E-Posta:
Doğrulama:
Lütfen bu kutuyu boş bırakın:
IRFP250 Nedir:
kısayollar: göndermek için alt+s veya önizleme yapmak için alt+p'ye basın