View previous topic :: View next topic |
Author |
Message |
MichaelG Guest
|
Yet another PWM question. |
Posted: Tue Jan 18, 2005 2:58 pm |
|
|
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
|
|
Posted: Tue Jan 18, 2005 3:03 pm |
|
|
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
|
|
Posted: Tue Jan 18, 2005 3:13 pm |
|
|
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
|
|
Posted: Tue Jan 18, 2005 3:16 pm |
|
|
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
|
|
Posted: Tue Jan 18, 2005 3:45 pm |
|
|
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
|
|
Posted: Tue Jan 18, 2005 3:50 pm |
|
|
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
|
|
Posted: Tue Jan 18, 2005 3:52 pm |
|
|
Ok, tnx for your help.
Regards
Michael. |
|
|
|