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

pic16lf1939 lcd internal driver and PWM

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



Joined: 04 Jun 2008
Posts: 23

View user's profile Send private message

pic16lf1939 lcd internal driver and PWM
PostPosted: Sun Jun 17, 2012 4:33 pm     Reply with quote

Hello
Can someone help me to use internal lcd driver to control an lcd and to use also pwm output of ccp2 to command a buzzer.
I tried to use Timer2 or Timer4 but no result. When I have included:
Code:
setup_timer_2 ( T2_DIV_BY_4, 0xc0, 2);

or
Code:
 setup_timer_4 ( T4_DIV_BY_4, 0xc0, 2);

the LCD doesn't show nothing and the program is not working anymore. When I comment only this line the program is working. I tried to program the ccp2 pin in this manner:
Code:

/***************
   CCP2SEL = 0; //RC1 is used for CCP2
   P2M1 = 0; P2M0 = 0;  //RC1 only pwm output - not full or half bridge use
   CCP2M3 = 1; CCP2M2 = 1;  //PWM OUTPUT on RC1
   
   setup_ccp2(ccp_pwm);     
   set_pwm2_duty(100);      // set pwm2 duty 
   C2TSEL1 = 0; C2TSEL0 = 1; // USE OF TIMER4 FOR PWM OF CCP2
   //setup_timer_4 ( T4_DIV_BY_4, 0xc0, 2);
   enable_interrupts(INT_TIMER4);

*///////////////////

but no effect - the buzzer is not working.

Thank you.
Best regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jun 17, 2012 4:52 pm     Reply with quote

Post the manufacturer and part number of your LCD. Post a link to the
data sheet or the web page for your LCD. We are not mind-readers.

Post the same thing for your buzzer.

If you are using a board build by some manufacturer, such as Microchip,
then post the part number of the board.

Post a more complete test program with #include, #fuses, #use delay,
variable declarations, main(), etc. It should compile with no errors.

Post your compiler version.

In other words, post all the usual stuff that we always ask for, so we
have a chance to solve your problems.
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