Try the attached PWM filter.
Play with the driver resistor and the load resistor to catch a nice signal out.
If you already have a signal amplifier, the NPN transistor may not be necessary.
Try the attached PWM filter.
Play with the driver resistor and the load resistor to catch a nice signal out.
If you already have a signal amplifier, the NPN transistor may not be necessary.
Hi, Sayzer
PWM is intended to know what you apply to your load, your design is very very very very far from giving a known output ... it's more an ON/OFF output than anything else.
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I don't really care for the HPWM command. I think it's easier to manually set the registers. This is a conversion from part of my code that may work for you to at least get the PWM working.
This is for an 8MHz oscillator (on a 18F2525, so double check register names):
T2CON = 4 'Timer2 = ON; Prescale = 1:1
PR2 = 200 '(period) this should give you should give you about 10KHz
CCPR1L = 100 '(duty cycle) 100 should be close to 50%, 20 is about 10%, etc
To turn PWM ON:
CCP1CON = 12
To turn PWM OFF:
CCP1CON = 0
Hi Acetronics,
PWM filter is not something I created through my output port; it is what picbasic pro recommends.
If you check the manual or help files, you will find this filter as a solution to scarry pwm out. Still, it is optional.
If you know something else, pls share it with us so that we can learn. Also, PWM is already an on/off state with different intervals on ON mode, on OFF mode etc. and this is called "modulation".
Hi, sayzer
As you're asking, it's a pleasure ...
Just insert a resistor between your Emitter and ground, and the transistor collector current will simply follow linearly ( w. a little offset due to Vbe ...) the PWM value ...
An U/I converter w/ OpAmp could wipe off this offset, if needed ...
No, no, don't send flowers ....
Alain
Last edited by Acetronics2; - 29th January 2006 at 12:33.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks