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 support@ccsinfo.com

Yet another PWM question.

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







Yet another PWM question.
PostPosted: Tue Jan 18, 2005 2:58 pm     Reply with quote

Hi

How can i get a 100hz PWM on a 16F877A @ 20mhz, in some of the topics there i some talk about software PWM but i dont really get (kind of a C newbie).

I would like to use that PWM to control the backlight/contrast on my GLCD but i dont know if its going to like a 1.2khz PWM??


Regards
MichaelG
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Jan 18, 2005 3:03 pm     Reply with quote

You can't using the PWM module. You could use the Compare feature and toggle the pin in an interrupt. If the backlight is an LED, it won't care about the frequency being 1.2KHz.
MichaelG
Guest







PostPosted: Tue Jan 18, 2005 3:13 pm     Reply with quote

The current LCD iam useing right now uses LEDs as backlight but in a few days ill be useing a Sharp LM32007T (320x200 pixel) display.

If iam going to use a hardware PWM at 1.2khz, how will i be able to use my 1ms interrupt routine?

Regards
MichaelG
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Jan 18, 2005 3:16 pm     Reply with quote

Well if you are using Timer2 for the 1ms then you aren't going to get a 1.2KHz. You will have to settle for something a bit faster. The LED's won't care.
MichaelG
Guest







PostPosted: Tue Jan 18, 2005 3:45 pm     Reply with quote

Ok, but assume that i will have a problem when switching to the Sharp LCD that is useing a CCFT backlight.

Regards
Michael.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Jan 18, 2005 3:50 pm     Reply with quote

You can't dim a CCFT by just supplying a pwm to the power. The driver for the CCFT would have to support the dimming.
MichaelG
Guest







PostPosted: Tue Jan 18, 2005 3:52 pm     Reply with quote

Ok, tnx for your help.

Regards
Michael.
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