nuno12345
Joined: 16 Jul 2008 Posts: 50
|
multiplexing + pwm |
Posted: Fri May 01, 2009 11:13 am |
|
|
Hello, i have multiplexed 16 LEDS into 5 pins connected from B0 to B5...
I can "blink" every LED, all working fine..but when I try to use pwm all my LEDS blink (with duty at 0) except LED 1, 3, 5 and 7, thats odd.
Code: | #fuses INTRC_IO, NOWDT, NOPUT, NOBROWNOUT, NOMCLR, NOLVP, NOPROTECT
#use delay(clock=8000000)
....
setup_ccp1(CCP_PWM);
setup_timer_2(T2_DIV_BY_4, 255, 1);
set_pwm1_duty(0); // PWM off
while(1)
{
for (i=0;i<17;i++)
{
ledON(i);
delay_ms(100);
}
} |
Must be a code problem because in proteus the same LEDs fail to "blink"
Thanks ;)
EDIT:
strange thing, if I change set_pwm1_duty to 50 LED 3, 4, 9, 10, 13 and 14 dont "blink" the others are fine :/
EDIT AGAIN:
Ok stupid me, pic 16f88 has pwm on pin B3 probably thats the problem...
So my question changes, is there any way to fade any of the available LEDs independently, using multiplex? |
|