CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

multiplexing + pwm

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nuno12345



Joined: 16 Jul 2008
Posts: 50

View user's profile Send private message

multiplexing + pwm
PostPosted: Fri May 01, 2009 11:13 am     Reply with quote

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?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group